Hi,
I have a little Mesh contained in a .x file.
I then load the mesh into the file and try to rotate it (I'm using the EmptyProject solution provider with DX February 2006).
My problem is that the Mesh doesn't rotate around the center of the mesh but
around it's base.
I was searching through the internet and I found this solution:
device.Transform.World = Matrix.Translation(x,y,z) * Matrix.RotationX(angle);
where x,y,z represent the center of the object.
but this just translates the object and then still rotates it around the base but in a different point.
To "draw" this:
0----------------------------- (this is what happens)
--------------0--------------- (this is what I want)
(0 represents rotation center)
Why doesn't this work and what is the correct way to do this
Thank you,
saso

Rotating around mesh center
SteveMeyns
Try switching the order of the transformations...
device.Transform.World = Matrix.Translation(x,y,z) * Matrix.RotationX(angle);
becomes
device.Transform.World = Matrix.RotationX(angle) * Matrix.Translation(x,y,z) ;