简体   繁体   English

如何垂直翻转Three.js纹理?

[英]How do I flip a Three.js texture vertically?

I'm trying to display some panoramic images in my "Street View"-like application with Three.js . 我正在尝试使用Three.js在我的“街景”类应用程序中显示一些全景图像。

I used the panorama example from the official webpage of Three.js as a base for the display of the images and it works OK. 我使用了Three.js官方网页上的全景示例作为图像显示的基础,它运行正常。 The problem is that my input images are flipped vertically . 问题是我的输入图像是垂直翻转的 By vertical flip I mean the effect shown in this image . 垂直翻转是指此图像中显示的效果。

So my question is if I can, somehow, flip the textures loaded from the images or the sphere geometry I apply the textures to, in order to view the images as it should be. 所以我的问题是,如果我可以,不知何故,翻转从图像加载的纹理或我应用纹理的球体几何体,以便按原样查看图像。

Thank you. 谢谢。

Luckily the vertical case is "natively" supported. 幸运的是,垂直情况是“原生”支持的。 Try with this: 试试这个:

texture.flipY = false;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM