r/GraphicsProgramming • • Jul 21 '22

Question 3D modeller question

Hi! excited to join this subreddit. I had 2 questions - do we need opencascade to program a 3d modeller, or does opengl have all the tools to build it ?

and, im planning to have the ui made with wxWidgets in python and have C modules extentions, so how do i get to display the workspace(3d space) inside the wxWidgets GUI? im so confused

I'm talking a full blown solidworks - like cad app.

thanks a lot guys

2 Upvotes

7 comments sorted by

4

u/LivelyLizzard Jul 21 '22

I don't know OpenCascade but from what I gathered from a quick google search, it will make your life a lot easier than doing all by yourself in OpenGL.

Idk what OpenCascade is based on but wx Widgets can draw OpenGL graphics via wxGLCanvas.

Btw as you are

talking a full blown solidworks - like cad app.

and the way you ask your question seems like you are a beginner, prepare for a long and hard time developing your idea. There is a reason there work more than 5 people at a company like this.

0

u/[deleted] Jul 21 '22

Thanks, good balanced answer. I wonder why this post is getting downvoted

6

u/LivelyLizzard Jul 21 '22

Probably because it reads like you haven't done enough research to realize that this is not a project a beginner should attempt. (Not meant in a mean way, we all start somewhere)

It's challenging as it involves a lot of technical and mathematical know-how because it's not just rendering a model, but also manipulating it. Even more so, a CAD program doesn't work with triangle meshes but CSG or B-rep which makes it harder. Additionally, the model has to be parametrized.

I guess OpenCascade can handle some of this but doing this from scratch is quite the task.

So the question has a similar vibe as the typical thing that happens in GameDev "I know next to nothing about GameDev, how do I make an MMORPG in 2 months?"

Another thing is people might have just read the title and assumed the post does not belong here.

I would suggest you start smaller. Render a simple triangle model. Add camera interactions like rotation, pan and zoom. Then move to interacting with the mesh (selecting vertices, edges and faces, move them, delete them...). For this you will probably find some tutorials or forum posts to get you started. Then move over to try and render other kind of models (for instance CSG and B-rep as mentioned above). Don't concern yourself with GUI in the beginning or use something for quick debugging UI like Dear ImGUI.

Even if you happen to use a third-party library that deals with that in the end, it gives you some experience in programming, how to structure your program, a much better understanding of scope and a feeling for how long things take. Plus, you get used to the general pipeline and lingo in the field and it forces you to learn new things and brush up on stuff you may already know.

3

u/wrosecrans Jul 21 '22

do we need opencascade to program a 3d modeller,

Certainly not. There are many modelling programs that don't use it.

or does opengl have all the tools to build it ?

Also no. OpenGL is ultimately an API for drawing triangles. You'll need to interact with the windowing system, handle input, doing geometry, reading and writing files, etc. How much of that you want to write yourself or get from third party libraries is up to you.

and, im planning to have the ui made with wxWidgets in python and have C modules extentions, so how do i get to display the workspace(3d space) inside the wxWidgets GUI? im so confused

WX has an OpenGL Widget: You draw into that according to the documentation: https://wiki.wxwidgets.org/WxGLCanvas

You seem to be pretty unclear about what the scope of OpenGL is, or how to work with it at all, so I'd just encourage you to start small, and scale down your expectations from something like SolidWorks as your starting point,

1

u/[deleted] Jul 22 '22

Yes I'm indeed confused by opengl. Also, I want to use C extension modules for the performance. Obviously I plan to learn about the apis I will need as I work through the project. I felt like knowing how to make a gui and displaying basic shapes in the app in a canvas ought to get me started, but I have so much trouble with how to get to display things. Any more advise is appreciated

1

u/the_Demongod Jul 22 '22

Writing your own GUI from scratch is a huge undertaking, I wouldn't recommend it unless you're already quite experienced in the API and graphics programming in general and are particularly interested in GUI development. Otherwise it's going to be a huge slog.

1

u/ShillingAintEZ Jul 21 '22

It's probably much more realistic to try to use webgl and make something that can select and move points first.