Rotate Show queried voxels
This very simple WebGL scene shows a green terrain and a red sphere which can be placed anywhere on the surface of the terrain.
If you click at the terrain, the red sphere will be placed at that location.
To rotate the terrain, drag the mouse cursor into the desired direction.
If you select "Show queried voxels" you can see which voxels of the terrain needed to be queried to find the point on the surface. The query starts at the bounding box of the terrain (indicated by a blue sphere) and then traverses voxels along the line of sight until a triangle from the surface mesh is hit.
terrain.zip (36 KB)