Jump to content
  • Advertisement
Sign in to follow this  

Weird problem with coordinates

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


Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!