LWJGL Forum

Programming => OpenGL => Topic started by: Soulice on December 08, 2005, 16:14:08

Title: Overhead 2d scroller
Post by: Soulice on December 08, 2005, 16:14:08
Due to mathematical limitations on the part of myself ( :D  ) I am converting a 3d game to 2d overhead.  I want to center the player, allow him to rotate, but scroll the background and other object while leaving the player centered.  I have done this in Java2D but wnated to find out if there is an LWJGL or OpenGL trick I am missing or just use tranlsates and offsets liek Java2D?

I am using GLU.gluOrtho2D(0, 800, 0, 600) to set up my display and it looks good so far (have not implemented motion yet).
Title: hmmmmmm...
Post by: Fool Running on December 08, 2005, 18:25:13
Using translates and offsets should work just fine.
Other people that have actually done 2D scrollers can chime in here. :lol:

QuoteDue to mathematical limitations on the part of myself ( :D  ) I am converting a 3d game to 2d overhead.
Out of curiosity, why did you have to change it to 2d?
Title: Overhead 2d scroller
Post by: elias4444 on December 08, 2005, 20:14:32
The math can indeed be tricky... but let me give you the clue that enabled me to soar past such obstacles:

Don't move the character! Move the entire world around them! To do so is just a translate call away.  :wink:
Title: rewrite
Post by: Soulice on December 08, 2005, 23:49:06
Just thought it may be easier as I had one similar already done.  But after some coding and testing today, I may stay with 3D (for now)  :wink: