title: Three JS Pivot point
body: <p>What I'm trying to achieve is a rotation of the geometry around pivot point and make that the new definition of the geometry. I do not want te keep editing the rotationZ but I want to have the current rotationZ to be the new rotationZ 0.</p>
  
  <p>This way when I create a new rotation task, it will start from the new given pivot point and the newly given rad.</p>
  
  <p>What I've tried, but then the rotation point moves:</p>
  
  <pre><code>// Add cube to do calculations
  var box = new THREE.Box3().setFromObject( o );
  var size = box.getSize();
  var offsetZ = size.z / 2;
  
  o.geometry.translate(0, -offsetZ, 0)
  
  // Do ratation
  o.rotateZ(CalcUtils.degreeToRad(degree));
  
  o.geometry.translate(0, offsetZ, 0)
  </code></pre>
  
  <p>I also tried to add a Group and rotate that group and then remove the group. But I need to keep the rotation without all the extra objects. The code I created</p>
  
  <pre><code>var box = new THREE.Box3().setFromObject( o );
      var size = box.size();
  
      var geometry = new THREE.BoxGeometry( 20, 20, 20 );
      var material = new THREE.MeshBasicMaterial( { color: 0xcc0000 } );
  
      var cube = new THREE.Mesh( geometry, material );
  
      cube.position.x = o.position.x;
      cube.position.y = 0; // Height / 2
      cube.position.z = -size.z / 2;
  
      o.position.x = 0;
      o.position.y = 0;
      o.position.z = size.z / 2;
  
      cube.add(o);
  
      scene.add(cube);
  
      // Do ratation
      cube.rotateY(CalcUtils.degreeToRad(degree));
  
      // Remove cube, and go back to single object
      var position = o.getWorldPosition();
  
      scene.add(o)
      scene.remove(cube);
      console.log(o);
  
      o.position.x = position.x;
      o.position.y = position.y;
      o.position.z = position.z;
  </code></pre>
  
  <p>So my question, how do I save the current rotation as the new 0 rotation point. Make the rotation final</p>
  
  <p><strong>EDIT</strong>
  I added an image of what I want to do. The object is green. I have a 0 point of the world (black). I have a 0 point of the object (red). And I have rotation point (blue).</p>
  
  <p>How can I rotate the object around the blue point?</p>
  
  <p><a href="https://i.stack.imgur.com/q6tg6.png" rel="noreferrer"><img src="https://i.stack.imgur.com/q6tg6.png" alt="enter image description here"></a></p>