Jump to content
  • Advertisement
Sign in to follow this  
jad_salloum

intersecting ray with scaled, rotated, translated mesh (Solved)

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

hi guys i have a ground mesh so what i did is i scaled it to 8 times and rotated it and then translated it to a new location . a car is moving on this ground so i am applying mesh.intersect to see if the car is on the ground and i am putting the location of the car center and with a direction downwards but i am not getting any intersection information. and the hit flag is false eventhough the car is on the ground . so how i can tell this mesh.intersect to use the new scaled, rotated, translated position of the ground to test on it if there is intersection or not ???? [Edited by - jad_salloum on November 29, 2005 2:46:45 AM]

Share this post


Link to post
Share on other sites
Advertisement
Since the intersect function accesses the model space vertices of the mesh, you must supply the ray to be tested in model space as well. That means that you must transform your world-space ray by the inverse of the matrix used to transform your terrain. Use the D3DXVec3TransformCoord and D3DXVec3TransformNormal functions to do this.

neneboricua

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!