Jump to content
  • Advertisement
Sign in to follow this  
GagleKas

OpenGL Isometric view

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

Hello,

I'm absolutely new to graphics and OpenGL.

I want to set an isometric view. How can I do this?

I have some code (Draw callback):


glMatrixMode (GL_PROJECTION);
glLoadIdentity ();
glOrtho (-2.0, 2.0, -2.0, 2.0, -2.0, 2.0);

glMatrixMode (GL_MODELVIEW);
glLoadIdentity ();
glRotatef (35.264, 1.0, 0.0, 0.0);
glRotatef (45.0, 0.0, 1.0, 0.0);

//draw something


An isometric view is an isometric projection, so I don't have to move the camera. Is this correct or I am mistaken? I don't move the camera thus it is at (0, 0, 0) looking to the negatives Z.

Note the near value of the frustum. It is negative. Is this correct or it has to be positive near zero, like 0.2?

Thanks.

Share this post


Link to post
Share on other sites
Advertisement
An isometric game is still 3D, it does use an orthographic projection, however it would probably be something more along the lines of
glOrtho (-10.0, 10.0, -10.0, 10.0, 0.1, 100.0);

The camera is usually always looking toward the same direction in an isometric game, but it does move around.

The kind of set-up you have would be good for 2D games.

Share this post


Link to post
Share on other sites
Quote:
Original post by Argo15
An isometric game is still 3D, it does use an orthographic projection, however it would probably be something more along the lines of
glOrtho (-10.0, 10.0, -10.0, 10.0, 0.1, 100.0);

The camera is usually always looking toward the same direction in an isometric game, but it does move around.

The kind of set-up you have would be good for 2D games.


Mmm, ok. Then if near value must be positive and I have an object centered in (0, 0, 0) I have to move back the camera on the z axis (positive Z direction) to see all the object inside the frustum.

Share this post


Link to post
Share on other sites
well, just like in perspective you can use gluLookAt(). I believe the only difference using an orthographic projection is that objects further away do not become smaller.

Your camera will still move around, but will always look at a specific direction, for example looking in the -1,-1,-1 direction would be like this.

gluLookAt(x,y,z,x-1,y-1,z-1,0,1,0);

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!