¿Cómo rotar un objeto 3D en el eje tres.js?

Tengo un gran problema con la rotación en three.js Quiero rotar mi cubo 3D en uno de mis juegos.

//init
geometry = new THREE.CubeGeometry grid, grid, grid
material = new THREE.MeshLambertMaterial {color:0xFFFFFF * Math.random(), shading:THREE.FlatShading, overdraw:true, transparent: true, opacity:0.8}
for i in [[email protected]]
    othergeo = new THREE.Mesh new THREE.CubeGeometry(grid, grid, grid)
    othergeo.position.x = grid * @shape[i][0]
    othergeo.position.y = grid * @shape[i][1]
    THREE.GeometryUtils.merge geometry, othergeo
@mesh = new THREE.Mesh geometry, material

//rotate
@mesh.rotation.y += y * Math.PI / 180
@mesh.rotation.x += x * Math.PI / 180
@mesh.rotation.z += z * Math.PI / 180

y (x, y, z) puede ser (1, 0, 0)

entonces el cubo puede girar, pero el problema es que el cubo gira sobre su propio eje, por lo que después de que haya girado, no puede girar como se esperaba.

Encuentro la pagina¿Cómo rotar un Three.js Vector3 alrededor de un eje?¿Pero solo deja que un punto Vector3 gire alrededor del eje mundial?

y he tratado de usarmatrixRotationWorld como

@mesh.matrixRotationWorld.x += x * Math.PI / 180
@mesh.matrixRotationWorld.y += y * Math.PI / 180
@mesh.matrixRotationWorld.z += z * Math.PI / 180

pero no funciona, no sé si lo usé de manera incorrecta o si hay otras formas ...

Entonces, ¿cómo hacer que el cubo 3D gire alrededor del eje del mundo?

Respuestas a la pregunta(9)

Su respuesta a la pregunta