我正在尝试根据用户的手部移动来移动飞机,但是我不希望z位置改变。我只希望平面的x和y位置根据用户手的位置而变化。有可能吗?
$ find -name '*.txt' -type f -print0 | parallel -0 grep --with-filename grep -Ff patterns.txt
答案 0 :(得分:0)
您可以将手的变换信号绑定到平面的X和Y轴,这样就可以手动控制Z轴的值。
const Scene = require('Scene');
const HandTracking = require('HandTracking')
//Make sure there's a plane named like this in the scene.
const plane = Scene.root.find('plane0');
const hand = HandTracking.hand(0);
//Fixed Z value signal
const planeZ = 0;
plane.transform.x = hand.cameraTransform.position.x;
plane.transform.y = hand.cameraTransform.position.y;
plane.transform.z = planeZ;