Jump to content
  • Advertisement
Sign in to follow this  
jonzy_x86

Translation vs Sin/Cos

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

Hi, This is one of my first posts on this board, it's with regards to OpenGL, but could be applied to DirectX too so I am writing it here... I am developing a 3D game with a point and click interface (similar to that of Populous or Command Conquer). So in my 3D world my camera is looking down the Z axis, at the ground. The units are viewed from above, the X axis moves units east and west and the Y axis moves units north and south. Now, my question is about translation. Consider this... Unit 1 is at location 0,0,0. Without using any opengl translations, I move this unit along the X axis some arbitrary value with the cos() function, and also along the Y axis with the sin() function. The precise sin and cos values are not important right now, let's say the unit is 10.0 units south east of 0,0 on the X,Y plane. This is all good, but now consider using OpenGL rotates and translation. Unit 2 is at 0,0,0 and I rotate by 45o clockwise, then translate along the X axis 10.0 units, my unit 2 is now in the same place as Unit 1, *however*, the X and Y values of Unit 1 and 2 are different. Is there any way to calculate the X/Y location using the OpenGL rotate and translate method? Any help would be much appreciated. Thanks Paul *Edit - Moved to the Math section*

Share this post


Link to post
Share on other sites
Advertisement

This topic is 3456 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.

Guest
This topic is now closed to further replies.
Sign in to follow this  

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!