Intersect VEX node

Computes the intersection of a ray with geometry.

This operator computes the intersection of the specified ray with the geometry, and returns the number of the hit primitive or -1. In the case of multiple intersections, the one closest to the ray origin will be used.

The uv values are the intrinsic interpolation coordinates for the underlying geometric primitive. For a triangle, they represent the barycentric coordinates of the triangle. For other primitives they may represent other values, such as parametric coordinates. They are not tied to any attribute values.

In order to use these values, you would need to interpolate an attribute for a primitive at the given coordinate. Please see the prim_attribute function, which takes these coordinates for evaluation.

Tip

Intersect will only check for intersections within the maximum length of the “Ray Direction” – [0, length(raydir)].

Usages in other examples

Example name Example for

Rivet object

Load | Launch