Spock
02-24-2009, 03:56 PM
Greetings...
Just wondering, what would be the most efficient way to implement parralax scrolling? --
1) Calcluate background offset from player position, relative to world map
2) Setup GL co-ordinates such that they match world map, and draw map from ( 0, 0 ) to ( mapWidth, mapHeight ).
3) Take advantage of the depth buffer somehow.. - I have heard of this, but I do not know how to set up co-ordinates such that the black 'offscreen' is not seen at any point on the map - i.e. so that there is always a part of the background drawn.
4) Different method/variation that I do not know ;)
Well, let me know, and thanks!
Just wondering, what would be the most efficient way to implement parralax scrolling? --
1) Calcluate background offset from player position, relative to world map
2) Setup GL co-ordinates such that they match world map, and draw map from ( 0, 0 ) to ( mapWidth, mapHeight ).
3) Take advantage of the depth buffer somehow.. - I have heard of this, but I do not know how to set up co-ordinates such that the black 'offscreen' is not seen at any point on the map - i.e. so that there is always a part of the background drawn.
4) Different method/variation that I do not know ;)
Well, let me know, and thanks!