Re: matrix rotation.

new topic     » goto parent     » topic index » view thread      » older message » newer message

I quote this from the Black Art of 3D Game Programming by Andrew LaMothe
(great book, highly recomended)...to adjust angle along z axis (up/down)
new_direction[x] = direction[x]*cos(angle) - direction[y]*sin(angle)
new_direction[y] = direction[x]*sin(angle) + direction[y]*cos(angle)

to adjust along the x axis (forward/backward)
new_direction[y] = direction[y]*cos(angle) - direction[z]*sin(angle)
new_direction[z] = direction[y]*sin(angle) + direction[z]*cos(angle)

Hope this helps,
Adam Weeden
WeedenSoft Technologies

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu