How to flip a Three.js texture horizontally

后端 未结 3 384
故里飘歌
故里飘歌 2020-12-06 10:56

I\'m making a 360 viewer, so textures are inside a cylinder. Problem is that they appear inverted horizontally.

I know about texture.flipY but I haven\'

3条回答
  •  离开以前
    2020-12-06 11:46

    Another approach here is to change the geometry. In the cylinder geometry you specify thetaStart and thetaLength for the cylinder section you want to render, and usually you choose a positive angle, i.e. thetaLength>0. If instead you pass thetaStart + thetaLength and -thetaLength to CylinderBufferGeometry, the cylinder is rendered clockwise instead of counter-clockwise, and all face normals now point inwards. So, there is no need to flip the texture anymore.

提交回复
热议问题