Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


OpenGL Isometric Tile Engine

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

Hi, I am making a isometric game engine using OpenGL, it uses textured quads. I got it to load a map and render it but it scrolls tile per tile, not pixel per pixel. How would I do this? In SDL i would draw to a surface larger then the screen and move that while updating that surface, but what about in OpenGL? Should I draw more then the screen and move the screen viewport? That doesnt seem to be correct? Any ideas would be helpful. Thanks.

Share this post

Link to post
Share on other sites
Luckily for you, I've done something similar to this, only in a 2d drawing system. The process should be similar though. Basically, you only draw the quads that would possibly be on-screen. This is really easy since you're moving 1 tile at a time. The way it works in 2d is something like this:

//xOff and yOff are the offsets of the screen (how many tiles it has scrolled by)
for(i=0;i < sWidth;i++) {
for(j=0;j < sHeight;j++) {
//Assume blt has the following syntax:

Now, if I understand what you're doing properly, you can do almost the exact same thing in 3d. All you really need to do is create 1 textured quad which you can move around to draw all the visible spaces (basically, it takes the place of the blt() function). Before each drawing, you would attach to it the appropriate texture (which from the example above would be tilePic[map[xOff+i][yOff+j]]).
Does this help?

[edited by - Cloral on August 30, 2002 12:12:27 AM]

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!