Sign in to follow this  

Weird problem with coordinates

This topic is 3585 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 have a right and forward vectors relative to a reference point (x, y, z). I just want to draw these two vectors with two lines so I do this to fill the variable:
vertices[0].Position = new Vector3((float)x, (float)y, (float)z);
vertices[0].Color = Color.White.ToArgb();
vertices[1].Position = new Vector3((float)x + (float)rx, (float)y + (float)ry, (float)z + (float)rz);
vertices[1].Color = Color.Red.ToArgb();

vertices[2].Position = new Vector3((float)x, (float)y, (float)z);
vertices[2].Color = Color.White.ToArgb();
vertices[3].Position = new Vector3((float)x + (float)fx, (float)y + (float)fy, (float)z + (float)fz);
vertices[3].Color = Color.Blue.ToArgb();
Then I draw with:
device.DrawUserPrimitives(PrimitiveType.LineList, 2, vertices);
But here is the result. I expected both vectors coming from the same point (x, y, z), but they cleary don't. Why is this?

Share this post


Link to post
Share on other sites
Have you stepped through this with PIX for Windows? It should allow you to inspect your pre- and post-transform geometry, so you can determine if the values being used are really the values that you wanted.

Also verify your FVF configuration and vertex declaration - a mismatch here could cause the problems you're seeing.

hth
Jack

Share this post


Link to post
Share on other sites

This topic is 3585 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this