Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

dfawcett

tell me if i understand correctly

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

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?

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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!"

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!