pseudo-Code raytrace