1. dummy = new THREE.Object3D();
plane = new THREE.Mesh(new THREE.PlaneGeometry(100,100),new THREE.MeshBasicMaterial({color:0xff0000}));
plane.position.set(50,0,0);
dummy.add(plane);
dummy.position.set(0,0,0);
scene.add(dummy);
由于three.js 模型默认旋转是以坐标轴 x, y z来旋转的,所以我们通过plane.rotation.x/y/z的方法只能绕其mesh的中心轴旋转,而无法绕边缘。 在这里plane为dummy的一个dhild,我们在旋转dummy的时候,plane也可以旋转。dummy也是绕中心旋转,我们只要设定好plane的坐标就好了。
在这个例子中,将Plane的左边缘的x的坐标设置为dummy的x的坐标的中心。谨记:plane坐标是相对于其parent坐标来设的,当设plane坐标时,将dummy的中心坐标看成是0,0,0而不是dummy在世纪坐标系中的坐标。