• Advertisement
Sign in to follow this  

2D Tile Engine - OpenGL

This topic is 3591 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

I am a total newb with OpenGL. I am writing a 2D tile engine using OpenGL in orthographic rendering mode. I would like to support a parallax scrolling method. My question is: should I translate all the foreground geometry in real time and stagger the background geometry in something like a half or 3/4 step? Initially I translated the view with the player (in model view I believe), but this led to ad hock translation calls on the background geometry to get it to scroll slower then the foreground. I just figured it would be quicker and easier this way. edit... I guess to sum up my thoughts. Should I be translating the view or all the geometry. My map is composed of a number of textured boxes (glVertex2d). thanks. [Edited by - smc on April 24, 2008 12:56:22 AM]

Share this post


Link to post
Share on other sites
Advertisement
If you are faking parallax using orthographic projection, translating the world geometry piece by piece and translating the "camera" (really translating all world geometry in the opposite direction) will be indiscernable to the user. The latter (translate the camera and the distant background) will be lighter on math, though; so just do what you're doing.

You could also get a real parallax using a perspective camera and putting your background further away, of course.

Share this post


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

  • Advertisement