如何水平翻转Three.js纹理 [英] How to flip a Three.js texture horizontally
本文介绍了如何水平翻转Three.js纹理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在制作一个360度观看者,所以纹理在圆柱体内。问题是它们看起来是水平倒置的。
I'm making a 360 viewer, so textures are inside a cylinder. Problem is that they appear inverted horizontally.
我知道 texture.flipY
但我还没找到 texture.flipX
on 来源。
I know about texture.flipY
but I haven't found a texture.flipX
on the source.
那么如何直接在代码中水平或沿x轴翻转纹理? (不使用图像编辑器)
So how can I flip a texture horizontally, or along the x axis, directly in the code? (not using an image editor)
推荐答案
答案比我想象的要容易。
The answer was easier than I thought.
cylinder.scale.x = -1;
并且不要忘记添加
material.side = THREE.DoubleSide;
这篇关于如何水平翻转Three.js纹理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文