我有一个关于 two.js
的问题。
如何设置网格的偏移量?
基本代码可在: http://lukas.achatz.ws/tst/webgl_003.html
我想要的是设置一个位置偏移,并且该点应该用作旋转引用。
我尝试过: mesh.applyMatrix( new THREE.Matrix4().makeTranslation( -2, 0, 0 ) );
但这只会移动场景中的网格。
最佳答案
您可以简单地执行以下操作:
var group = new THREE.Group();
scene.add( group );
var mesh = new THREE.Mesh( ..., ... );
mesh.position.set( -2, 0, 0 );
group.add( mesh );
关于javascript - WebGL/Three.js 设置网格偏移,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25088391/