Collision Detection of 3D Objects in p5js (.obj files)

Опубликовано: 12 Октябрь 2024
на канале: JS64
274
3

Collision detection of 3D objects using the following method:
for each face of the .obj project the position of the ball onto the face of that polygon
check if the point where the ball is projected onto the plane is within the triangle of that face
do this by summing the angles between the three vectors defined by the projected point to each vertex of the triangle, if the sum is 2PI then the projected point is within the triangle (shown as the red ball in the video)
if the projected point is within the triangle then check the distance from the projected point to the player, set a threshold value for collision

I started a new channel specific to JS Game Dev since this one became more SM64 focused    • Projecting a Point to a Plane in 3D  

   • 3D Collision Detection using a triang...