Jump to content
  • Advertisement
Sign in to follow this  
Dean1988

sin/cos Camera Rotation? Why? How?

This topic is 4853 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 guys Basically, in my Dx app, i have a mesh infront of me. I can move around the world easily, adjusing the X,Y,Z to move backwards, forwards, left, right, up and down. However, turning round has become an issue. I understand the basic's of Trig, like how to get the Hypotenuse length, how to get the size of an angle using 2 sides, and how to get the length of a side using an angle and a side length. But i don't understand how this can be used to rotate me in a 3D world..atm, if i use Matrix.RotationY() when i turn round my keys are the wrong way round, so this isn't a viable option, so i'm looking to learn how to use Sin/Cos effectively so i can get to grips with Direct3D. I'm using Managed DX9 if it helps. Cheers.

Share this post


Link to post
Share on other sites
Advertisement
This is more of a conceptual problem really. There is a difference between rotating the camera, and rotating the object which represents the player. Normally you want to rotate the player in response to input, in such a way that the "player controls" are also rotated to match - such that for example the up key is always "forward", i.e. the direction that the graphic representing the player faces. Then, the camera is controlled by separate logic, which (a) keeps it at an appropriate distance from the player, and (b) causes it to point in the direction from itself to the player.

Try asking in Graphics Programming and Theory instead. :)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!