Jump to content
  • Advertisement
Sign in to follow this  
lucky6969b

Performing a Ray Testing against a transformed ID3DXMesh?

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

The mesh I load from file is stored into a container and is a untransformed version,

each time it gets instanced out, I add a transform to it.

I don't really store a transformed version in my container.

Now a ray is cast, the ray does not hit the mesh because it is untransformed.

In case I really want to, I need to break down the vertex buffer and apply the world transformation at runtime

to each vertex, which I think not very effective.

Because the mesh is coming out of a MeshManager,

If I store a transformed version in it, then it won't make sense anymore

Because 2 instances coming from the meshmanager refer to the same mesh,

the 2 instances point to 2 different places but only one copy for both.

What is your opinion?

Thanks

Jack

Edited by lucky6969b

Share this post


Link to post
Share on other sites
Advertisement
Transform the ray with the inverse of the mesh instance's transform to move the ray into model-space, and then transform the hit location with the mesh instance's transform to move back 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!