# Rotation of a 3d angle.

Hi folks. I’m sure this answer is out there a hundred times, but I’m struggling to find anything that makes sense. I’m pretty sure this is because I’m a bit thick!

I’m trying to create a 3D, non friction steering system. I have an object moving between arbitrary points without any problem, but I’m struggling to add steering.

In a 2D project I just hold a steering value as a single of radians, and I add or reduce this value by a thrust force, Turn this into a vector and multiply it into my Velocity.

This is exactly what I wan’t to do in the 3D environment, but now I need a steering 3D vector, which I need to rotate. That’s where I’m stuck.

Is there a magic way to achieve this, (rotate 3D vector towards xyz by rr radians), do I need to do this as a manual process, or should I be using a Matrix translation?

I guess if I start with a vector of 0,1,0 and CreateRotation(xx,yy,zz) that’s what I’m looking for? Is the resulting vector the same length?

Brain at boiling point!!

Any help with this would be great.

Many thanks.

You can use Quaternions and axis angle
or.
You can use Matrix AxisAngle and your world Matrix’s Up and Right normal vector to create a rotation matrix that you can multiply against your current World Orientation matrix to stear it left or right from the current forward look at vector.

You can alternately instead use system vectors to perform system coordinate turns.
Just using create rotation and multiplying it by your world matrix.

In that case you might as well just use Quaternions for the rotations Quaternions can make things simpler or harder depending on the use case.

In the case you want to use matrices and make a fully free camera.

Think of it with your fore finger index and thumb orient each finger 90 degrees to the other point them in front of you this is the system orientation it is unchanging your thumb is up your index is left or right ect.

Then move your wrist this is your world orientation it has up your thumb and left althogh these are no longer equal to the system vectors you never the less have them in your world matrix as vectors and can use them for axis angle rotations to create a up or down axis angle rotation to reapply to that same world orientation matrix.