0

如何在 Three.js 中访问 VR 耳机方向?WebXRManager 似乎没有提供这样做的方法。

4

1 回答 1

1

您可以从用于渲染场景的相机中提取方向。演示时尝试以下操作:

const position = new THREE.Vector3();
const rotation = new THREE.Quaternion();
const scale = new THREE.Vector3();

// the following line extracts the position, rotation and scale in world space

camera.matrixWorld.decompose( position, rotation, scale );
于 2021-01-11T22:17:35.037 回答