Making A Simple 3D Program

Hello,

I’m curious if anyone may be able to give me advice on a way to get started making a 3D program. I would like to make a program to create simple primative shapes with nurbs. If anyone knows any good resources to learn this from please let me know.

Im not sure if there are any libraries, frameworks or SDKs that are helpful for this sort of thing.

For example, I’m not sure how to really make an interface. Should I be using openGL, directx etc for making a viewport window

If anyone has a good way to get started or Github repositories I may be able to learn from please let me know!

Thank you

1 Like

Welcome to the forums @Noah_Lynaugh!

To help answer this question, I think it’d be great to know what skills you have as there are many Rhino SDKs and resources :slight_smile:

2 Likes

Skills in what sense? Programming or 3D modeling skills?

I have a great amount of experience with 3D modeling. Programming I am intermediate. I have made a few projects like a website builder with python and I have also made some embedded projects and GUI apps with C++.

1 Like

Yeah exactly, both are handy for sure.

This page lists all of the guides for each language Rhino - Guides.
This page lists the API references Rhino - API References
And there are samples here GitHub - mcneel/rhino-developer-samples: Rhino and Grasshopper developer sample code

I’m still not exactly sure what you’d like your program to do, but if you want to manipulate Rhino and create GUIs, I consider C# to be the best option for that, many people also use python to much success as well :slight_smile:

3 Likes

Thank you, That will be useful in the future. Right now, I would like a low level understanding of how geometry is made and how to make a viewport/ windowed program that allows for the creation of simple shapes like a sphere and cube.

I want to understand how to make a CAD program from scratch essentially and want to start with the absolute basics and as few abstractions as possible.

1 Like

@Noah_Lynaugh you would like to start from scratch and build a CAD package like Rhino? Is this an educational endeavour? :slight_smile:

It’s definitely possible. You’ll likely want to go lower than C# though. Rust or C++ would be a good bet, that’ll let you access everything you need.

Do you want to write your own geometry library? If not you can use OpenNurbs/Rhino3dm to save you some of the hassle.

If you want to write a Rendering engine for this and make 3d things appear on the screen I think https://www.libsdl.org/ would be a good bet, it wraps OpenGL which should make life simpler.

2 Likes

Yes, educational to teach myself, not for a class or anything.

Thank you so much callum.

1 Like

I look forward to seeing the results! I’m sure many on the forum would love to be kept updated on your progress :slight_smile:

1 Like

Another low-level library I like a lot is GitHub - liballeg/allegro5: The official Allegro 5 git repository. Pull requests welcome! - not a full game-engine, but a game programming library. Very similar to libsdl.

I would honestly start with SDL, SFML, or my fave glfw (very lean). Those provide cross-platform windowing, keyboard and mouse inputs, sound, etc.
On top you can then implement your geometry library from scratch. The rendering can be done with OpenGL, Vulkan, Metal or whatever floats your boat. I’ve seen people render full three-dimensional scenes with ASCII characters in a terminal. OpenGL even though old, is probably your best bet. There’s lots of documentation about it out there.
If you want a straightforward solution for a GUI, you can use Dear ImGUI. I’ve also heard good things about Godot, yes, the game engine. How they do the GUI is supposed to be very neat.

However, if you’re primarily interested in implementing a geometry library, like me, to explore computational geometry algorithms and stuff, I’d skip all of the above. I would whole heartedly recommend openFrameworks (instead of Processing) and of course Rhino and its scripting capabilities.

For non-Rhino projects, I often write a simple SVG exporter for 2D geometries in order to preview them in a browser. SVG is also a neat format since you can feed it to a plotter or laser cutter. For 3D geometry, I mostly work with meshes, and an OBJ exporter is very easy to implement.

2 Likes