在Three.js中访问VR耳机方向



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

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

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 );

最新更新