Public Group

# rotate a vector by degree

This topic is 2894 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## 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 on other sites

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 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

1. 1
2. 2
Rutin
20
3. 3
khawk
16
4. 4
A4L
14
5. 5

• 11
• 16
• 26
• 10
• 11
• ### Forum Statistics

• Total Topics
633756
• Total Posts
3013710
×