Hey there! Three.js beginner here. So, I have a question. This is the code I use:
{
const mtlLoader = new MTLLoader();
mtlLoader.load(‘model.mtl’, (mtl) => {
mtl.preload();
const objLoader = new OBJLoader();
objLoader.setMaterials(mtl);
objLoader.load(‘model.obj’, (root) => {
scene.add(root);
window.myObject = root;
});
});
}
Later, on button click in separate JS function I rotate the object like this:
myObject.rotation.z -= 0.1;
My problem is it’s rotating against it’s base (bottom part), not against object’s actual center.
Now I’ve searched and searched and tried number of solutions, but I guess I’m still missing how it supposed to work. Any help would be really appreciated!