如何水平滑动纹理与三个js的球体(How to slide a texture horizontally accross a sphere with threejs)

编程入门 行业动态 更新时间:2024-10-23 23:21:40
如何水平滑动纹理与三个js的球体(How to slide a texture horizontally accross a sphere with threejs)

我有一个360浏览器。

我想在特定的位置加载纹理,将原始纹理旋转几度或Y单位,而不会影响除旋转以外的图片。

我将如何做到这一点?

I have a 360 viewer.

I want to load a texture in a specific position that rotates the original texture a number of degrees or Y units around without affecting how the picture shows up other than the rotation.

How would I do this?

最满意答案

如果你想围绕你的球体的y轴旋转你的纹理,你可以按照下面的模式:

var loader = new THREE.TextureLoader(); var texture = loader.load( 'path.jpg', function ( texture ) { texture.wrapS = THREE.RepeatWrapping; texture.offset.set( degrees / 360, 0 ); } );

three.js r.91

Here is a pattern you can follow if you want to rotate your texture around the y-axis of your sphere:

var loader = new THREE.TextureLoader(); var texture = loader.load( 'path.jpg', function ( texture ) { texture.wrapS = THREE.RepeatWrapping; texture.offset.set( degrees / 360, 0 ); } );

three.js r.91

更多推荐

本文发布于:2023-08-06 19:06:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1454607.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:球体   纹理   水平   js   slide

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!