# OpenGL Isometric view

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

## 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);
glOrtho (-2.0, 2.0, -2.0, 2.0, -2.0, 2.0);

glMatrixMode (GL_MODELVIEW);
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 on other sites
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 on other sites
Quote:
 Original post by Argo15An 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 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);

1. 1
Rutin
27
2. 2
3. 3
4. 4
5. 5

• 11
• 11
• 10
• 13
• 20
• ### Forum Statistics

• Total Topics
632948
• Total Posts
3009398
• ### Who's Online (See full list)

There are no registered users currently online

×