Question

I am trying to make a function that will invert a Three.js Geometry across the xz plane. Scaling the geometry by (1, -1, 1) will effectively do just this, but now the planes that were facing outwards are facing inwards, so I can see through the geometry.

I know there is a way to render both sides of the faces, but I'd rather not so I can speed up render times. Is there an easy way I can toggle which face of a plane is shown?

Was it helpful?

Solution

material.side = THREE.BackSide or material.side = THREE.DoubleSide.

However, three.js does not support reflections in the object matrix -- it only supports pure rotations and (positive) scale factors. By setting a negative scale factor, you are reflecting the geometry of the object.

For more on this, see Transforming vertex normals in three.js.

three.js r.58

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top