PDA

View Full Version : Rotation of lines wrt x-axis



umeshvl
11-24-2009, 04:44 AM
Am drawing lines in xy plane,co-ordinates are in close range like
(-74.01244599,40.692543 ,0)
(-74.012445 ,40.6925639,0)
(-74.012365 ,40.692633 ,0)

glOrthox(-74.047249,-73.907204,40.679516,40.882000,-1.0,1.0);

glRotatex(3.0,1.0,0.0,0.0);
i tried applying the above rotation on x axis.
Output looks like lines are being translated in -y axis. is it like camera is being moved up ?

i want to rotate lines(on xy plane) wrt x-axis(closer to xz plane).how can this be done?

kroneml
11-24-2009, 06:05 AM
I'm not sure if this is the problem, but shouldn't you use "glRotatef"? What is glRotatex supposed to do? Are you using OpenGL ES?

umeshvl
11-24-2009, 09:47 PM
ya, am using opengl ES with fixed input. As i was posting in opengl forum,thought to post in float values.

is my understanding of camera pitch being rotated correct ?
i had referred this link for my understanding
http://www.songho.ca/opengl/gl_transform.html .

then how can i rotate the lines(objects) around x axis ?

Thanks.

umeshvl
12-03-2009, 11:15 PM
posting answer to my question.Might help to someone who looks this topic.

The whole set of lines which i tried to draw was being rotated wrt x-axis. But due to co-ordinates being very near it appeared to be translated along y-axis.

Its better we design coordinates symmetric around (0,0,0).then i set glortho around (0,0,0). After that i could rotate lines around xy-plane.