Is OpenGL the right tool to render a 3D image?

Started by NeilAgg, January 02, 2023, 04:59:42

Previous topic - Next topic


I have been creating images like this one by hand:

I would like to write a tool in Java that will automate them.

From what I can tell, I need to use a 3D tool that will allow me to lay out objects in a scene and then take a rendering of the scene.
Reading the LWJZGL docs, I think I need to use OpenGL but I don't need GLFW since my code will run "headless" - I just need
to place the objects in the virtual space and trigger the rendering to an image.

All the tutorials I am finding are talking about GLFW so I am not sure where to start.

I am using Eclipse. I created a Maven project and added the LWGL dependencies.

Can someone point me in the right direction?


    OpenGL is just an API which communicates with the GPU. The way programmers transfer 3D models to 2D is to use math. That is, OpenGL do most of the math in GPU, which is faster. But you can also do the math in CPU, that doesn't matter. But you can just search for OpenGL tutorials online, most posts will teach you about the computer graphics knowledge. It will take some time to learn. :)
    Of course you can render your scene headless. But I would recommend you to follow the online tutorial which would probably teach you how to render your scene in GLFW window. After you get familiar with OpenGL, there is a thing called "Texture".
    In OpenGL, your scene will be rendered on a framebuffer, and you can render the framebuffer to a specified texture. And for example, we can get the data back from the texture and transfer it to an image file. That should be what you want.