implements algorithm to detect intersect of rays from camera and scene objects, returning closest object