0
\$\begingroup\$

I'm attempting to develop an orthogonal game with lwjgl 3 and OpenGL in Eclipse, but I can't find an answer for rendering objects in 2D or 3D. Are both applicable? And if so what are the advantages of either one? I would also like to rotate my camera if that changes your answer.

\$\endgroup\$
1
\$\begingroup\$

The orthographic camera should almost always only be used in 2d. Instead you should use the perspectivecamera

You can read more about the orthographic camera here: https://github.com/libgdx/libgdx/wiki/Orthographic-camera

Read more about creating 3d games in libgdx here: https://xoppa.github.io/blog/basic-3d-using-libgdx/

On this site it is explained why you should use the perspective camera for 3d instead of the orthographic camera: http://www.gamefromscratch.com/post/2014/12/08/LibGDX-Tutorial-Part-16-Cameras.aspx

\$\endgroup\$
0
\$\begingroup\$

You can use it for both.

It makes z coordinate not affect any vertex positions, so you can use it for 2D games.

But it also allows you to use features like z-buffering and there is nothing wrong with rendering 3D objects with it.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.