ScratchData LogoScratchData
Back to sureornot's profile

Ray-Triangle Intersection

SUsureornot•Created July 11, 2020
Ray-Triangle Intersection
8
4
84 views
View on Scratch

Instructions

Ray-Triangle Intersection algorithm: 。3 vertices of a triangle could form a plane. 。Calculate a ray-plane intersection. 。Check if the intersection is inside the triangle. (this project using barycentric coordinates) Sliders to rotate and green flag to start rendering. Space bar to reset.

Description

Normal of a triangle ABC n = (C-A) X (B-A} / || (C-A} X (B-A) || Plane equation: P。n - A。n = 0 (。= dot product) Combine with the ray equation P = Pο + P1 (t) (Pο + P1(t))。n = A。n t = (A。n - Pο。n) / P1。n

Project Details

Project ID410955641
CreatedJuly 11, 2020
Last ModifiedJuly 18, 2021
SharedJuly 11, 2020
Visibilityvisible
CommentsAllowed