Results 1 to 6 of 6

Thread: C#: Rotating Mesh

Threaded View

  1. #1

    Thread Starter
    <?="Moderator"?> john tindell's Avatar
    Join Date
    Jan 2002
    Location
    Brighton, UK
    Posts
    1,099

    C#: Rotating Mesh

    Hey i am trying to move and rotate a Mesh. I am using DirectX 9 and C#.

    I can move my Mesh backwards and forwards, along the Z axis. But the mesh rotates about a fixed point, the point from where the Mesh was first drawn.

    heres the code i am using to draw the Mesh

    Code:
    device.Transform.World = Matrix.Scaling(Scale,Scale,Scale)
    * Matrix.Translation(new Vector3(m_X,m_Y,m_Z))
    * Matrix.RotationY( m_Rotation);
    
    for(int i = 0; i < carMaterials.Length; i++)
    {
    device.Material = carMaterials[i];
    device.SetTexture(0,carTextures[i]);
    carMesh.DrawSubset(i);
    }
    I does rotate but about the wrong point? any ideas?

    Thanks
    Last edited by Electroman; Dec 8th, 2004 at 07:24 PM. Reason: Added Language to title.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width