-
Notifications
You must be signed in to change notification settings - Fork 43
Open
Description
python通过socket将欧拉角和对应的关键点传给blender,blender中能按照摄像头画面运动,YXZ模式。
python通过WebSocket将同样的数据传给vue3中的Three.js,前端头和胳膊的姿势对,腿在收到数据后直接竖直向上,脚跑到头顶了,这是什么原因?
部分前端代码
console.log("收到消息:", JSON.parse(data));
const parsedData = JSON.parse(data);
const { bone, location } = parsedData;
// 调整骨骼位置
if (model) {
for (let i = 0; i < bone.length; i++) {
const obj = model.getObjectByName(bone[i]);
model.position.set(location[0], location[2], -location[1]);
if (obj) {
const euler = new THREE.Euler(
parsedData.rotation[i][0] - 0,
-(parsedData.rotation[i][2] - 0),
parsedData.rotation[i][1] - 0,
"YXZ"
);
obj.rotation.copy(euler);
}
}
}
});```


Metadata
Metadata
Assignees
Labels
No labels