[SOLVED] Rotating an object around its own axises - Issue with Z

UPDATE: I found the issue with my own logic, the ModelRotation variables are rotating all objects based on the world’s axises, not only Z. In order to rotate around their own axises further implementations are needed. The post can be ignored/deleted. (I can’t find how to delete it)

Hi All,

I started to develop a Monogame 3D project.
I have a world with its own X,Y,Z base axises and I have several objects scattered around.
(My origo is 0,0,0 and every object is placed at its own spot p(x,y,z) )
Plus I have the following rotation Matrix (the default from every tutorial):

Matrix rotationMatrix = Matrix.CreateRotationX(Obj.modelRotationX) * Matrix.CreateRotationY(Obj.modelRotationY) * Matrix.CreateRotationZ(Obj.modelRotationZ) * Matrix.CreateTranslation(Obj.modelPosition);

Now, the problem is, if I adjust the modelRotationX or modelRotationY values, the 3D object properly rotates around ITS OWN X or Y axis. I would expect the same behaviour when I adjust the modelRotationZ variable, but it is not happening like that. If I adjust the modelRotationZ value, the object is being rotated on the Z axis of the world (On the Z base world axis like it is being stinged into the center of the object), instead of the object OWN Z axis.
This is really sad, because I would like to have objects in my “air” anywhere, and I would like to be able to rotate them into any position. On X / Y it works, on Z it isnt.

For example: My object’s Z axis is perfectly parallel with the base Z axis. I modify the Z rotation to 30radian, the object perfectly pitches/rotates by 30 degrees. (This is just because its axis Z is parallel with the base axis Z) And then, I rotate it also by 30radian on the Y axis, so the object turns nicely right, it has its speed, it’s moving, so it turns in properly on a nice curve, It would be expected that it keeps its Z pitch, but it isnt. it begans to rotate weird as its axis Z is not parallel anymore with the base Z.
My question is: why? Why rotation X and Y rotates the object around its own Y and Y axis, why the Z rotates it around the world’s Z axis being stinged into the middle of the object?

One guy recomended that I edit my title to include the prefix [SOLVED]… Which I found pretty neat. -Makes it easier for us forum users I think…