Skip to main content

computeTriangleRayIntersectionBarycentric

computeTriangleRayIntersectionBarycentric(result, origin_x, origin_y, origin_z, direction_x, direction_y, direction_z, ax, ay, az, bx, by, bz, cx, cy, cz) ⇒ boolean

Compute barycentric coordinates for triangle intersection NOTE: most of the code is inlined for speed to avoid allocation and function calls

Kind: global function
Source: https://en.wikipedia.org/wiki/M%C3%B6ller%E2%80%93Trumbore_intersection_algorithm (Möller and Trumbore, « Fast, Minimum Storage Ray-Triangle Intersection », Journal of Graphics Tools, vol. 2,‎ 1997, p. 21–28)
See: https://github.com/erich666/jgt-code/blob/master/Volume_02/Number_1/Moller1997a/raytri.c

ParamTypeDescription
resultArray.<number>[t,u,v, normal_x, normal_y, normal_z] will be written here
origin_xnumber
origin_ynumber
origin_znumber
direction_xnumber
direction_ynumber
direction_znumber
axnumber
aynumber
aznumber
bxnumber
bynumber
bznumber
cxnumber
cynumber
cznumber