• 14
• 12
• 9
• 10
• 9

# Weird problem with coordinates

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

## 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 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