Help: Mesh vector location?
/*This is in a RenderWorld class that I made for a game im making. Im having a problem with picking/setting a vector location with in the mesh, the mesh in the code, under the Obj.Mesh down below. If some one can help me findout how to get the meshs vector location, that would be sweet, thanks.*/
//Note: this is C#
#region RenderWorld_Functions
public void OnCreateDevice(object sender, DeviceEventArgs e)
{
Model NewModel = null;
NewModel = new Model(ref e.Device);
NewModel.Load("tiger.x");
ModelList.Add(NewModel);
}
public void OnResetDevice(object sender, DeviceEventArgs e)
{
e.Device.Lights[0].Type = LightType.Directional;
e.Device.Lights[0].Diffuse = System.Drawing.Color.FromArgb(255, 255, 255);
e.Device.Lights[0].Direction = new Vector3(0.0f, 0.0f, 8.0f);
e.Device.Lights[0].Enabled = true;
e.Device.Lights[0].Update();
e.Device.Lights[1].Type = LightType.Directional;
e.Device.Lights[1].Diffuse = System.Drawing.Color.FromArgb(255, 255, 255);
e.Device.Lights[1].Direction = new Vector3(0.0f, 0.0f, -8.0f);
e.Device.Lights[1].Enabled = true;
e.Device.Lights[1].Update();
e.Device.Lights[2].Type = LightType.Directional;
e.Device.Lights[2].Diffuse = System.Drawing.Color.FromArgb(255, 255, 255);
e.Device.Lights[2].Direction = new Vector3(0.0f, -0.33f, 0.66f);
e.Device.Lights[2].Enabled = true;
e.Device.Lights[2].Update();
}
public void OnDestroyDevice(object sender, EventArgs e)
{
Model Obj;
for (int i = 0; i < ModelList.Count; i++)
{
Obj = (Model)ModelList;
if (Obj != null)
Obj.Dispose();
}
}
public void OnFrameRender(Device device, double appTime, float elapsedTime)
{
device.RenderState.Lighting = true;
device.RenderState.Ambient = System.Drawing.Color.White;
Model Obj;
for (int i = 0; i < ModelList.Count; i++)
{
Obj = (Model)ModelList;
Obj.Render(); // where the mesh object is located <----
}
}
#endregion
I don't really use MDX, so bear with me for a sec. Is Model your own class? If so, you should have some kind of interface for setting / getting its position (like GetPosition() & SetPosition(), ect..)
I don't quite understand your question - maybe explain it in a little more detail.
I don't quite understand your question - maybe explain it in a little more detail.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement