问题描述
我尝试使用一个oculus quest手追踪的示例,并尝试获取每只手的旋转角度。 因此,我重新混合了一个小故障脚本来展示。我得到了手的object3D的ID,但是当涉及到位置和旋转时,总是返回0。
任何指示,请问这里可能有什么问题?
运行示例: https://glitch.com/edit/#!/tremendous-enchanting-zebra?path=hand-test.js%3A21%3A0
代码试图获取位置
AFRAME.registerComponent("hand-test",{
schema: {
hand: { default: "right",oneOf: ["left","right"] }
},init: function() {
AFRAME.log("Init");
},tick: function() {
let hands = document.querySelectorAll("[tracked-controls]");
if (!hands) {
AFRAME.log("No hands found");
return;
}
for (var i = 0; i < hands.length; i++) {
let obj = hands[i].object3D;
AFRAME.log("hand: " + obj.id + " rot: " + obj.rotation.x);
}
}
});
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)