Вы можете использовать один из этих THREE.js
методов:
// set a vector from the cursors matrix world
vec3.setFromMatrixPosition(cursorEl.object3D.matrixWorld);
// fill a vector using the getWorldPosition
cursorEl.object3D.getWorldPosition(vec3)
Проверьте это в этой скрипке .
Использование в пользовательскомcomponent.
Имея такую настройку
<a-camera>
<a-cursor my-component></a-cursor>
</a-camera>
У вас может быть такой компонент:
AFRAME.registerComponent("my-component", {
init: function() {
this.vec = new THREE.Vector3()
},
tick: function() {
this.vec.setFromMatrixPosition(this.el.object3D.matrixWorld);
// do something with this.vec
}
})