PDA

View Full Version : Isometric Projection



MOlOX
12-08-2009, 01:09 AM
Hi, i am "so beginner" in openGL. So sorry if two questions are so easy.

I was told to draw curved line with 2D calculation and then transform it to 3d by rotating shape on x / y / z axis. And the picture should be viewed as isometric projection.

I am not gonna ask for code help but if anyone could help with openGL basics question, i will be so happy.

Question 1 :
I started to read about openGL and i tried to figure how to do "isometric projection". As i read i could do it by using glOrtho
and gluLookAt function. it's ok, but the book was also saying , "with using glOrtho you can draw only 2d", what i am trying
to do need 3d so, i thought that i could not use glOrtho, so i decided , i need to use gluPerspective , but again this time, i could
not find and document providing isometric projection with glPerspective, so i am very very very confused now.
Can anyone explain which one i should use, to provide, isometric projection and how (glOrtho or glPerpective) ?

Question 2 :
For transforming 2 line curved line to 3d object, i though like this

i will calculate vertexes for line (from math expression). then for each vertex i will rotate vertex by using glRotate and then i will have vertexes for,
'x' degree from x/y/z axis. and so by connecting these vertexes, i will have solid 3d object. but then when i saw the rotation functions , i felt stucked :)

The Problem : i need to =>
this is coordinate x, y ,z , rotate these coordinates for x degree on x,y,z axis. so new i get x',y',z' , so now i can draw line x degrees rotated on any axis

The thing we can do with openGL is
Draw vertex
glVertex*(x,y,z)
Rotate Next coming Vertex
glRotate*(30,1,0,0)
Draw rotated vertex
glVertex*(x,y,z)

Now for summary:
i am able to calculate coordinates for 2d (coordinated comes from math formula)
i need to calculate these 2d coordinates' new rotated coordinates so as i will able to connect and draw quads them to form solid 3d object
But there is not calculation method as far as i can see.

What is the strategy in this position ?

Thank you bearing with me, if you can answer one, or all of these questions , i will not be lost my sanity, so i will greatly appreciate your help

Thank you

ZbuffeR
12-08-2009, 04:00 AM
1) the book is misleading. glOrtho is a good way to do isometric projection. What book is that ?

2) You need something to lathe ? Check this :
http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=208874&page=1