sourcelibs/RayTrace/demos/sphere.xtl

1⍝!/usr/bin/env xetal 2"rt:" u̲se< "RayTrace" 3clip ← 0.001 100.0 1e-10 0.0001 4sphere ← 0.0 0.0 0.0 1.0 5origins ← 3 3 r̲eshape 0 0 3 0 0 0 1 0 3 6directions ← 3 3 r̲eshape 0 0 -1 7hits ← (((clip ʳᵗs̲phereHit sphere) origins) directions) 8"Outside, inside and tangent ray parameters:" 9ʳᵗd̲istances hits 10points ← (f̲loat origins) + (ʳᵗd̲istances hits) '× t̲able 0.0 0.0 -1.0 11"Outward normals, including the exit from inside:" 12sphere ʳᵗs̲phereNormals points