three获取模型的世界坐标中正面朝向旋转值

getWorldQuaternion使用四元数获取
// 从模型局部坐标获取正面朝向
const localFront = new THREE.Vector3(0, 0, -1); // 默认正面方向
localFront.applyEuler(model.rotation);

// 考虑父级变换,获取世界旋转方向
const worldQuaternion = new THREE.Quaternion();
model.getWorldQuaternion(worldQuaternion);
localFront.applyQuaternion(worldQuaternion);

console.log('模型正面方向 (世界坐标系):', localFront);

 

getWorldDirection:使用vec3获取

const worldFront = new THREE.Vector3();
model.getWorldDirection(worldFront);

console.log('模型正面方向 (世界坐标系):', worldFront);

 

posted @ 2025-06-05 20:32  SimoonJia  阅读(21)  评论(0)    收藏  举报