One way is to wrap the object in the parent object, shift the position of the internal object, and then apply the transforms to the parent object.
The code below will shift the pivot point (or convert the origin) along the Y axis by 1 meter.
<a-entity rotation="0 45 0"> <a-box position="0 1 0"></a-box> </a-entity>
This composite component may also work:
var originalPosition = new THREE.Vector3(); var originalRotation = new THREE.Vector3(); AFRAME.registerComponent('pivot', { dependencies: ['position'], schema: {type: 'vec3'}, init: function () { var data = this.data; var el = this.el; var originalParent = el.object3D.parent; var originalGroup = el.object3D; var outerGroup = new THREE.Group(); originalPosition.copy(originalGroup.position); originalRotation.copy(originalGroup.rotation);
source share