如何水平滑动纹理与三个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
更多推荐
发布评论