0
votes

I am facing a ray tracing problem using MATLAB and now I am a bit frustrated. I have some points in the 3D space that define a surface. I represented it with small 3-D triangles using the Delaunay algorithm with the matlab function "trisurf". Then, I have my "ray", that is basically a 3-D vector. My target is to find the point of intersection (X, Y, Z) between this vector (that is a curve, not a straight line). Does exist in matlab a function able to do this or anyone has any suggestion? Thanks in advance for your help,

Leonardo

1

1 Answers

0
votes

I represented it with small 3-D triangles using the Delaunay algorithm with the matlab function "trisurf".

This sounds like a triangle mesh to me.

I have my "ray", that is basically a 3-D vector.

A ray is a point of origin and a direction, so it should be two vectors, not one.

My target is to find the point of intersection (X, Y, Z) between this vector (that is a curve, not a straight line).

If you have a set of triangles and a ray, then you can loop over all the triangles and perform a ray/triangle intersection test on each one.

There are a number of algorithms for the intersection test. A popular one is Moeller-Trumbore.