且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

three.js在其中心围绕Y轴旋转Object3d

更新时间:2023-02-02 10:34:26

看看Object3D的 rotateOnAxis(axis,angle)函数。
应该是这样的:

Have a look at Object3D's rotateOnAxis(axis, angle) function. It should be something like:

//declared once at the top of your code
var axis = new THREE.Vector3(0.5,0.5,0);//tilted a bit on x and y - feel free to plug your different axis here
//in your update/draw function
rad += radIncrement;
object.rotateOnAxis(axis,rad);

HTH