Ray intersect of mesh

Software: Away3D 4.x

3dNewb, Sr. Member
Posted: 20 October 2012 06:55 PM   Total Posts: 105

Seems an obvious enough quest, couldn’t find the answer with the search though.

I have a Ray and a Mesh.

I would love to get 2 things:

1. at what vector does the Ray intersect the Mesh?
2. what is the normalVector of that specific Face.

and before I implement such a thing, what are your thoughts on this performance-wise. Do I want to do something like this at every frame?

   

Avatar
alihm, Jr. Member
Posted: 20 October 2012 08:27 PM   Total Posts: 49   [ # 1 ]

Have you tried AwayPhysics? you can have ray collision and it gives you the normal vector of the colliding face. It’s also very fast.

   

3dNewb, Sr. Member
Posted: 21 October 2012 11:16 AM   Total Posts: 105   [ # 2 ]

Thanks for your suggestion. I am not using AwayPhysics though, was kinda hoping for a Away3D -standard solution.

   

Avatar
alihm, Jr. Member
Posted: 21 October 2012 11:59 AM   Total Posts: 49   [ # 3 ]

AwayPhysics is pretty fast since the core code is compiled with Alchemy. Otherwise looping thru geometry vertexBuffer and doing all the math yourself is the only option that I know of. You can find lots of tutorials and code samples on the math part googling “ray triangle intersection”.

Hope it helps.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X