Loading a mesh then rotating it about x and y axis

Hi,

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 = meshmaterialsIdea;
device.SetTexture(0, meshtexturesIdea);
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.

[1212 byte] By [eggie5] at [2007-12-23]
# 1
member variable: float angle = 0.0f;

in some loop
angle += some increment;
device.Transform.World = Matrix.RotateX(angle) * Matrix.RotateY(angle) * Matrix.Translation(0.0f, 0.0f, 0.0f);

I hope this helps.
Take care.

PieterGermishuys at 2007-8-30 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: DirectX 101...
# 2
Do you mean RotationX and RotationY?
eggie5 at 2007-8-30 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: DirectX 101...