toxi,
@toxi@mastodon.thi.ng avatar

Earlier today[1], helped my son with a raycasting issue and then ended up updating/extending the 2D shape intersection function in https://thi.ng/geom, which now also supports ray intersections with nested shape groups/hierarchies (via same single function call) and a new option to return all intersection points found (rather than just the first/closest). Both of these features are shown in a new example project (forthcoming) and in the anim below...

#2D #Geometry #Shapes #Intersection #RayCasting #ThingUmbrella #TypeScript #JavaScript

[1] It also was the first day of the year for us working outside on a bench in the woods, yay!

2D line art animation showing some shapes (rectangles, circles, hexagon, wavy polyline...) and a line/ray rotating anti-clockwise. The intersection points between that ray and the static shapes are highlighted as pink dots. Each dot also has a label showing the distance from the ray origin (center of image). Depending on the angle and shapes intersected, the number of intersections varies (max. approx. 10 points)

  • All
  • Subscribed
  • Moderated
  • Favorites
  • typescript
  • ngwrru68w68
  • rosin
  • GTA5RPClips
  • osvaldo12
  • love
  • Youngstown
  • slotface
  • khanakhh
  • everett
  • kavyap
  • mdbf
  • DreamBathrooms
  • thenastyranch
  • magazineikmin
  • megavids
  • InstantRegret
  • normalnudes
  • tacticalgear
  • cubers
  • ethstaker
  • modclub
  • cisconetworking
  • Durango
  • anitta
  • Leos
  • tester
  • provamag3
  • JUstTest
  • All magazines