Skip to content

CristianoPizzamiglio/moeller-trumbore-algo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

The Möller–Trumbore ray-triangle intersection algorithm, named after its inventors Tomas Möller and Ben Trumbore, is a fast method for calculating the intersection of a ray and a triangle in three dimensions without needing precomputation of the plane equation of the plane containing the triangle.

Example Usage

>>> vertices = np.array([[0.0, 0.0, 0.0], [0.0, 10.0, 0.0], [10.0, 0.0, 0.0]])
>>> ray_origin = np.array([1.0, 1.0, 1.0])
>>> ray_direction = np.array([0.0, 0.0, -1.0])
>>> intersection = ray_triangle_intersection(vertices, ray_origin, ray_direction)
(1.0, 0.1, 0.1)

Acknowledgment

Wikipedia, Scratchapixel and pyvista

About

Möller–Trumbore ray-triangle intersection algorithm.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages