Simulator Mechanics

Hey hey,

I am trying to make a flight simulator.
But having a problem with rotations.

I know the distance travalled and know the angle of the x and z axis.

In 2D rotation is simple :
zi = Math.sin(Math.toradians( z-rotation) )
xi = Math.cos(Math.toradians(z-rotation))

in 3D you also have the y-axis movement.
I can make it wordk, that the rotation is showing, that the object moves along the X and Y axis, but it also is moving over the Z-axis.

How do you calculate the complete movement over the axis of the object. ?? ??? ???

It kind of depends on the order of rotation. I would recommend extracting the “forward” vector from your viewing matrix. You can the scale this by how far you want to move and there you have it. Much simpler and avoids redoing the trig functions. If your viewing matrix is:

m00 m10 m20 m30
m01 m11 m21 m31
m02 m12 m22 m32
m03 m13 m23 m33

then your forward vector is (m02, m12, m22) and helpfully it is already normalized.