Rotate 3D Model from a custom position
- by Nipuna Silva
I have a 3D Model like above in which i want to rotate it from a given location(pointed in red) but I can only rotate it from the middle. How can I rotate it from a custom point.
Edit:
I successfully able to rotate the model from the below position by getting the radius of the model and applying it to the world matrix
Vector3 point = new Vector3(-radius, 0, 0);
world = Matrix.CreateTranslation(-radius, 0, 0);
But now I cannot change the position of the object and it always centered in middle of the screen. I think that's because i applied the above code. How can I place it anywhere I want?