Yasei-no-otoko / blastbuster-vr

The Game for LEAP Motion VR Mount

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

blastbuster-vr

The Game for LEAP Motion VR Mount

Teaser site http://www.circle-hydrangea.net/perilous-dimension-english/

Method: Leap Motion's easy method to get 2D-position is interactionBox.NormalizePoint() However, it coordinate is different from a pass-through image. Therefore I acquire the coordinate of the fingertip edge using the next method.

GameObject[] fingerTips = new GameObject[10];
Frame frame = controller.Frame();
Vector3 pos = frame.Hands[x].Fingers[y].Bone(Bone.BoneType.TYPE_DISTAL).NextJoint.ToUnity(HandController.mirrorZAxis);
fingerTips[i].transform.localPosition = pos;
fingerTips[i].transform.LookAt(camera.transform.position);

And I confirm whether a finger-tip covered up a target with a viewport coordinate.

Vector3 shootPos = camera.WorldToViewportPoint(fingerTips[i].transform.position);
Ray ray = camera.ViewportPointToRay(shootPos);

Contacts

© 2013 Haruto Watanabe

About

The Game for LEAP Motion VR Mount