我将 Leap Motion 传感器连接到 Oculus Rift SDK2 设备,以便在 Three.js 场景中通过“头戴式”模式识别我的手。
controller.use('handHold').use('transform', {
optimizeHMD: true
}).use('handEntry').use('screenPosition').use('riggedHand', {
parent: scene,
renderer: renderer,
scale: getParam('scale'),
positionScale: getParam('positionScale'),
helper: false,
offset: new THREE.Vector3(0, 0, 0),
renderFn: function() {
renderer.render(scene, camera);
return controls.update();
},
materialOptions: {
wireframe: true
},
dotsMode: getParam('dots'),
stats: stats,
camera: camera,
boneLabels: function(boneMesh, leapHand) {
if (boneMesh.name.indexOf('Finger_03') === 0) {
return leapHand.pinchStrength;
}
},
boneColors: function(boneMesh, leapHand) {
if ((boneMesh.name.indexOf('Finger_0') === 0) || (boneMesh.name.indexOf('Finger_1') === 0)) {
return {
hue: 0.6,
saturation: leapHand.pinchStrength
};
}
},
checkWebGL: true
}).connect();
但我认为“optimizeHMD = true”行被忽略了,跳跃传感器仍然像在桌面模式下一样识别我的手。
我会很感激一些帮助!