This topic is now archived and is closed to further replies.

Why is the x axis inverted?

This topic is 5090 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''m using C# with MDX9. For some reason, negative X is towards the right, and positive X is to the left. Is there something I''m missing? Shouldn''t it be the other way around? Here''s my setup and drawing code:
private void SetupCamera()
    device.RenderState.CullMode = Cull.None;

    device.Transform.Projection = Matrix.PerspectiveFovLH((float)Math.PI / 4, this.Width / this.Height, 1.0f, 100.0f);
    device.Transform.View = Matrix.LookAtLH(new Vector3(0,0, 5.0f), new Vector3(0.0f, 0.0f, 1.0f), new Vector3(0,1,0));
    device.RenderState.Lighting = true;

public void DrawLegoMan(float x, float y, float z)
	device.Transform.World= Matrix.Translation(x, y, z);
	CustomVertex.PositionNormalColored[] verts = new CustomVertex.PositionNormalColored[6];
    verts[0].SetPosition(new Vector3(-0.1f, 0.1f, 1.0f));
    verts[0].SetNormal(new Vector3(0.0f, 0.0f, -1.0f));
    verts[0].Color = System.Drawing.Color.White.ToArgb();
    verts[1].SetPosition(new Vector3(-0.1f, -0.1f, 1.0f));
    verts[1].SetNormal(new Vector3(0.0f, 0.0f, -1.0f));
    verts[1].Color = System.Drawing.Color.White.ToArgb();
    verts[2].SetPosition(new Vector3(0.1f, -0.1f, 1.0f));
    verts[2].SetNormal(new Vector3(0.0f, 0.0f, -1.0f));
    verts[2].Color = System.Drawing.Color.White.ToArgb();
	device.DrawUserPrimitives(PrimitiveType.TriangleList, 1, verts);

Share this post

Link to post
Share on other sites