Loading a mesh then rotating it about x and y axis
I have a mesh, xwing.x, which is a simple x wing model.
I am able to load it onto my form and display it w/ the following code:
LoadMesh("C:\\xwing.x", ref spacemesh, ref spacemeshmaterials, ref spacemeshtextures, ref spacemeshradius);
This is my render method:
public void RenderScene()
{
device.Clear(ClearFlags.Target, Color.DarkSlateBlue, 1.0f, 0);
device.BeginScene();
//Draw Mesh
for (int i = 0; i < meshmaterials.Length; i++)
{
device.Material = meshmaterials
;
device.SetTexture(0, meshtextures
);
mesh.DrawSubset(i);
}
device.EndScene();
device.Present();
}
Next, I would like to know how to rotate my model about the x and y axis. I was messing around w/ something like this in my render method:
//this does the rotating
device.Transform.World = Matrix.Translation(-5, -10 * 1 / 3, 0) *
Matrix.RotationAxis(new Vector3(0, 0,1), angle);
Can somebody help me along? What I want is pretty simple. I just want to load a mesh and rotate it about the x and y axis given an x and y property.

