Jump to content
  • Advertisement
Sign in to follow this  
thedodgeruk

rotate a vector by degree

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

if i have a vector , i.e x,y,z


this points in a direction

i want to be able to rotate this vector , how would i do this


rotateVectorZ (vect, 45);


void rotateVectorZ(D3DXVECTOR3 & vect, float degree)
{

}

i think its to do with sin and cos , but not too sure, any help please

Share this post


Link to post
Share on other sites
Advertisement

if i have a vector , i.e x,y,z


this points in a direction

i want to be able to rotate this vector , how would i do this


rotateVectorZ (vect, 45);


void rotateVectorZ(D3DXVECTOR3 & vect, float degree)
{

}

i think its to do with sin and cos , but not too sure, any help please

First, convert the degrees to radians. [ google: 43,000 hits ]

Googling for "rotate 3d vector" results in over a million hits, one of which is http://www.siggraph....tran/3drota.htm

You, too, can google. It's not that hard.

Share this post


Link to post
Share on other sites

[quote name='thedodgeruk' timestamp='1295108226' post='4759304']
if i have a vector , i.e x,y,z


this points in a direction

i want to be able to rotate this vector , how would i do this


rotateVectorZ (vect, 45);


void rotateVectorZ(D3DXVECTOR3 & vect, float degree)
{

}

i think its to do with sin and cos , but not too sure, any help please

First, convert the degrees to radians. [ google: 43,000 hits ]

Googling for "rotate 3d vector" results in over a million hits, one of which is http://www.siggraph....tran/3drota.htm

You, too, can google. It's not that hard.
[/quote]


cheers, could not find just a simple explaination of vector rotation , that was perfect, cheers :)


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!