• Advertisement
Sign in to follow this  

Picking a scaled mesh

This topic is 4311 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
Are you trying to pick the mesh itself or the bounding box around the mesh.

Share this post


Link to post
Share on other sites
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