Announcing a small Addon to deal with intersections between Rays, Lines, Planes, Triangles etc. Still in the works but some Stuff already fully functional. Maybe you have suggestions for missing intersections

Mostly Based on Paul Bourkes Paper on Lines and Planes: http://paulbourke.net/geometry/pointlineplane/ and with a little help from toxic-libs for PlanePlane intersection.

Not sure why, but my add-ons don’t seem to appear in the list.
Have fun


hey @matthias, this is great, thanks for the add. we have a bug in ofxaddons that is causing some addons to not show up, new addons will show up when we get around to fixing it.


this is great.

i have tried to use it with ofSpherePrimitive. I used the mesh example and replaced the lofi-bunny.ply with

ofSpherePrimitive sphere;
mesh = sphere.getMesh();

but nothing happened.

i want to find an intersection point from a ray that originates from the centre of the sphere.


You should use the sphere with

sphere.set(200, 10,OF_PRIMITIVE_TRIANGLES);

Then everything should work as expected.
I uploaded an example to github with ray-sphere intersection.
Hope this helps.


it’s perfect.
thanks a lot.


sorry for reviving that old one, but can we use it for lines / lines intersections ?
Actually, I should go https://en.wikipedia.org/wiki/Bentley–Ottmann_algorithm probably…