three.js rotate Object3d around Y axis at it center

3d, rotation, three.js

Solution

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

Problem

I have an `Object3d` in `Three.JS` that is a group of some Mesh objects. I want to rotate this group around the Y axis, at it center, that is far from world center (0,0,0). I just know the `Group.rotate.y += deg` code, but for each axis direction it always rotate the object around (0,0,0), not my group center! How can i fix this? UPDATE: Read the comments

Original source

Related problems