Jump to content
  • Advertisement
Sign in to follow this  
rustycoder

Translation Problem

This topic is 3921 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

Hello Everybody, I've been playing around with picking and ray intersections and I thought I was doing something wrong until I realized that the problem isn't with my intersections, but with the objects themselves. I move an object to (0,0,5) but when I attempt to do an intersection check it fails at that point. BUT D3DXIntersect returns true at the origin. I have been unable to find anything about this problem on these forums or anywhere else so I am hoping someone can point me in the right direction. Thanks! -Rusty

Share this post


Link to post
Share on other sites
Advertisement
Ok I wanted to clarify my post a little:

I load a mesh, and move it. It appears to move correctly but when I try to do a D3DXIntersect it doesn't work on the loaded mesh. HOWEVER, when I perform an intersection check at the origin it works.

Hope this helps you all!

Share this post


Link to post
Share on other sites
D3DXIntersect() assumes the mesh is at the origin, since AFAIK meshes don't store their translation, you apply that before rendering.

So, you need to adjust your ray to compensate for this.

Share this post


Link to post
Share on other sites
Thanks Steve,
That was a 2 second fix, I was just uncertain if there was something major going on with my rendering. It makes sense now since there is no position storage in the mesh itself. Thanks again!
-Rusty

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!