Search code examples
javascript3dthree.jswebgl-globe

WebGL Globe Position in scene


I am playing around with the WebGL Globe and have got it to rotate, but can't figure out how to position it so that it is not in the center of the scene.

I have altered the code at https://code.google.com/r/fxnstyling-webgl-globe-autospin/source/browse/ to be:

mesh = new THREE.Mesh(geometry, material);
    mesh.position = new THREE.Vector3(1000, 500, 300)
    mesh.matrixAutoUpdate = false;
    scene.addObject(mesh);

How can I change the position of the globe?


Solution

  • You have matrixAutoUpdate set to false, so the position isn't going to be updated until you explicitly call update again. Try calling mesh.updateMatrix() when you need the position to be updated.