tell me if i understand correctly
its taken my a while to get a grasp on this whole translate rotate stuff but heres my thinking
to make an object(poly) at say x100,y50,z0 i need to loadidentity then translate to those coordinates. then draw
if i want to rotate an object(poly) i need to center myself according to the object. then apply the rotation.
i guess this is the underling stuff i dont see useing other languages where as i would simply say "rotate object 1,xang,yang,zang"
am i understanding this correctly?
http://www.lectersoft.com
December 30, 2001 10:13 AM
This is how I think of it, all rotations happen around the origin.
So if you want to rotate around a point you need to make that point the origin by a translation. Then you rotate and then translate back again.
eg to rotate around (1,2,4)
Translate (-1,-2,-4)
Rotate
Translate (1,2,4)
Hope this is of some use to you.
So if you want to rotate around a point you need to make that point the origin by a translation. Then you rotate and then translate back again.
eg to rotate around (1,2,4)
Translate (-1,-2,-4)
Rotate
Translate (1,2,4)
Hope this is of some use to you.
quote:
Original post by dfawcett
i guess this is the underling stuff i dont see useing other languages where as i would simply say "rotate object 1,xang,yang,zang"
First of all, OpenGL isn''t a ''language''. What other languages are you talking about?
Second, OpenGL doesn''t know, or care about ''objects''. It''s a rendering API, not a high level object-scene managment library.
And matrix translations aren''t the only way to position an object. You can offset all vertex points by the location to achieve the same effect.
Alex Broadwin
A-Tronic Software & Design
-----
"if you fail in life, you were destined to fail. If you suceed in life, call me."
"The answer is out there."
"Please help, I''m using Windows!"
Alex Broadwin
A-Tronic Software & Design
-----
"if you fail in life, you were destined to fail. If you suceed in life, call me."
"The answer is out there."
"Please help, I''m using Windows!"
Alex BroadwinA-Tronic Software & Design-----"if you fail in life, you were destined to fail. If you suceed in life, call me.""The answer is out there.""Please help, I'm using Windows!"
i used darkbasic if anyones ever used it they would understand the trouble of moveing/rotateing objects in opengl. i know what opengl is and is not.
i figured it out i hope. i preserve any camera movement with a push, then i go back to 0,0,0 with a loadidentity, perform any translate, rotate, scale THEN i draw my object and finally bring back my original camera setting with a pop.
i figured it out i hope. i preserve any camera movement with a push, then i go back to 0,0,0 with a loadidentity, perform any translate, rotate, scale THEN i draw my object and finally bring back my original camera setting with a pop.
http://www.lectersoft.com
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement