OpenGL Scrolling

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

Recommended Posts

Anyone know of a tutorial about 2D sidle-scrolling in OpenGL? Basiclly I have a large map and want to move the character in any direction.

Share on other sites
just use gluLookAt() and translate it along the side of your map whenever a key is pressed.

gluLookAt is a VERY easy function to use.
gluLookAt(camPositionX, camPositionY, camPositionZ,          targetX, targetY, targetZ,          0, 1, 0);  //this is the "up" vector. it tells the camera which direction is up

Share on other sites
Hmmm.... but what if I can't determine how man keypresses are enough to move the main character/object? Also, not pressing anything might still mean you are moving (gravity).

Share on other sites
Ok, since no one knows of any tutorials can someone answer this question: I wan't to have large map files which will be bitmaps, should I split the map into sections and load each section when I need it or should I just load the whole thing?

Share on other sites
i know of no tutorial since im not interested in that field
perhaps look at www.libsdl.org theres plenty of games there (with sourcecode) many use opengl

Share on other sites
Quote:
 Original post by subfloodHmmm.... but what if I can't determine how man keypresses are enough to move the main character/object? Also, not pressing anything might still mean you are moving (gravity).

Movement shouldnt be a direct result of input, input should just be a parameter into a movement function which handles interactions with things like gravity and other collisions.

as for the map, make it title based if you can that way you wont need to store the whole level as one bitmap but just the tiles and then you put them in the right places when drawing

1. 1
2. 2
Rutin
22
3. 3
4. 4
frob
18
5. 5

• 33
• 13
• 10
• 9
• 11
• Forum Statistics

• Total Topics
632567
• Total Posts
3007109

×