Hide objects that obstruct the camera's view

A couple of small demos on using a Raycaster to detect and hide objects that obstruct the camera’s view in a 3D scene.

Make an object see-through when it’s in the way
In this first simple and contrived demo, rotate the scene until the ball its center is obscured by the cube, and the cube will turn translucent.

Hiding the walls of a structure
In this next more robust demo, the walls of the structure are switched from solid to wireframe whenever they block the camera (you could instead lower their opacity, or some other useful effect). Use the right, on-screen joystick to rotate the custom orbital camera around the scene.

2 Likes

Nice demos! :+1:

1 Like