Jump to content
  • Advertisement
Sign in to follow this  
Adriano

Picking a scaled mesh

This topic is 4548 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. Is there a way to pick a mesh that has been scaled in a world transform (so it's vertices in the vertex buffer are still in the original place)? I use the D3DXIntersect function. Can I pick the scaled mesh without scaling the vertices in its vertex buffer?

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
There is an easy way just calculate the inverse of the mesh's transform matrix and bring the ray in the mesh's local space and then perform the intersection test in local space.

Share this post


Link to post
Share on other sites
Thx for replies

I intersect each mesh container mesh-data using D3DXIntersect.
I use the inverse of whole mesh world-matrix to transform origin and direction vector.
It seems to me, anyhow, that this doesn't work with scaled meshes.
Am I wrong?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
scaling is always relative to the origin, so it will work but of course you have to "inverse transform" the ray in every way you transform the object from local space to world space

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!