OpenGL + Isometric

Started by
4 comments, last by smr 17 years, 4 months ago
I am working on an isometric engine using OpenGL and I'm looking for some input. So far I've seen three ways I could design this (and tried them all with example programs): 1) Use glOrtho to get a flat window. Make diamond-shaped floor textures, put them onto square quads like any 2d API. Make diamond-shaped wall textures and put them down as textured quads too. I personally don't like this because I think it wastes space and it doesn't take advantage of the power of OpenGL like the other two methods, but it could definitely work. 2) Use glOrtho to get a flat window. Make square-shaped floor textures, but use textured diamonds to construct the floor. Make square-shaped wall textures but use textured parallelograms to construct the walls. I could probably make this work, but I'm wondering if it would be easier to go with method number 3, which is... 3) Use glOrtho to get a flat window. Use calls to glTranslatef and glRotatef (in some order I apparently haven't figured out yet) to view the world from the characteristic side angle. Draw the world as though it were a 3d model, e.g. square tiled floor with square vertical walls. This seems to make the most sense to me, but I can't make heads or tails of the rotation and translation to get it to look right at all. (I'd like to avoid any calls to GLU functions so gluLookAt is probably out...) Any tips, horror stories, or example code are more than welcome. I am not otherwise concerned with objects and sprites right now - would just like to get floors and walls going. Also, I do not anticipate messing with height in my engine, so that will hopefully simplify some things. I've made a sample with each of these methods and number 2 seems easiest to me, but I don't want to progress too far before realizing I made a poor choice and having to dump everything and start anew.
My 4eV entry: Euro1943
Advertisement
currently my project is a sdl/opengl iosmetric rpg, basicly im using a dimond shaped glquads for the top and parallelogram glquads for the 2 sides of tiles. the main advanatge is that i can take one texture and apply it to any of the three viewable sides;
so if i understand you im using #2, the only problem i see with #3 is that mouse mapping and tile culling could be more chalenging
If you go the fully 3D route and simply rotate/position the camera such that the view is isometric or near-isometric, you gain the advantage of light sources for shading, which can certainly add depth to the game.

I considered going this route, however due to time constraints and general lack of knowledge I went with a fully 2D engine instead. YMMV so if you have the knowledge and time, absolutely go for a 3D tile engine.
It looks like that's what I'll do then. I found this topic on page 2:
http://www.gamedev.net/community/forums/topic.asp?topic_id=415721

Using the transformations in that order with 60 for orthoAngle I was able to get the 2:1 perspective I need (although I know camera transformations are supposed to go in MODELVIEW and not PROJECTION).
My 4eV entry: Euro1943
Yes... the third option is the way to go. It will make your like much easier by putting the calculations and rendering work (hiding walls and objects when appropriate) on the 3D library, which can do it fairly quickly.

Dino M. Gambone
Good judgment is gained through experience. Experience, however, is gained through bad judgment.

Currently working on Rise of Praxis MUD: http://www.riseofpraxis.net/

Quote:Original post by Dino
Yes... the third option is the way to go. It will make your like much easier by putting the calculations and rendering work (hiding walls and objects when appropriate) on the 3D library, which can do it fairly quickly.


Not only this, but it makes creating artwork easier as you don't have to draw tiles and wall textures in an isometric perspective. Sprites will still need to be though, unless you go 100% 3D.

This topic is closed to new replies.

Advertisement