Jump to content
  • Advertisement
Sign in to follow this  
Synergy

OpenGL 2d+3d = synergy?

This topic is 5458 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello im trying to add some 3d to my games, so i decieded to create a simple way of mixing the two, i have experience with 2d in opengl by textured quads, but now that im thinking about adding some 3d model loading (for players) in a 2d world , im wondering how will my normal 2d code have to adapt... To clarifiy there will be multiple 2d texture layers,some above and some below the models. 3d lighting doesnt intrest me due to its limitations, i plan to just use animated lightmaps. I believe using glortho is unusable? i suppose il need to first 'setup 2d' mode to draw the tiles below the models, then 'goto 3d mode' and draw the models, then flip back to 2d mode and draw on top of the models. Is this a decent way to approuch it? What renderstates are needed for 3d? How do i place the camera in a way to display both 3d/and 2d and keep the texture size right? Should use depth for drawing multiple layers like a Z-variable? Not sure if this creates any problems in 2d.. Any help would be appreciated

Share this post


Link to post
Share on other sites
Advertisement
I think you are dramatically overcomplicating the problem.

Just place your 3d model on the screen the same way you place your Quads. There is nothing wrong with using orthogonal projections for 3d. You may not realize it but your 2d apps are actually 3d, your just ignoring the Z axis.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!