Public Group

#### Archived

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.

## 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 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:      //dest.blt(destx,desty,sourcePic)      buffer.blt(i*tWidth,j*tHeight,tilePic[map[xOff+i][yOff+j]]);   }}

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]

1. 1
2. 2
3. 3
Rutin
22
4. 4
JoeJ
16
5. 5

• 14
• 29
• 13
• 11
• 11
• ### Forum Statistics

• Total Topics
631774
• Total Posts
3002291
×