I’m building a 3d scatterplot visualizer, and I always want there to be a grid behind the points, regardless of how the camera is rotated/oriented. I’ve used THREE.GridHelper to make 6 grids that are aligned to make a cube, but I’m not sure how to make the sides facing the camera not show.
To show an example, I’ve faded out 3 of the grids (the ones front-facing the camera in this shot) and outlined those faces in red:
I want those to be hidden, and if the user rotates the camera, they would show if no longer facing the camera. This would also mean that if the user zoomed inside the plot, they would see a grid on all 6 sides if they rotated the camera view around.
I can achieve this effect easily if I create a (solid) plane geometry and just use THREE.BackSide on the material; for grid/lines, however, it seems to not be as simple. Would also be nice if I could achieve this with a single piece of geometry as opposed to 6 individual meshes/geometries.
Here’s a codepen with this grid in place:
Appreciate any help!
Adam