问题
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?
回答1:
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
来源:https://stackoverflow.com/questions/17431316/how-to-toggle-threejs-outer-face-direction