Rotate 3D Model from a custom position

Posted by Nipuna Silva on Game Development See other posts from Game Development or by Nipuna Silva
Published on 2011-11-23T10:54:19Z Indexed on 2011/11/23 18:06 UTC
Read the original article Hit count: 308

Filed under:
|
|

enter image description here

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?

© Game Development or respective owner

Related posts about XNA

Related posts about xna-4.0