Upload
james-birt
View
499
Download
2
Embed Size (px)
Citation preview
Introductory Leap Motion and VR in Unity
3dDr James Birt
Requirements• Unity 5.3 or higher• Oculus runtime 0.8+ installed• Leap motion Orion Beta
Download Unity 3D Leap Motion Core Assets
https://developer.leapmotion.com/unity
Create new Project
Enable VR Mode
Import LeapMotion_CoreAsset_Orion_4.1.1
Setup LeapMotion VR Scene• From LeapMotion>Prefabs drag a LMHeadMountedRig into your
scene Hierarchy and remove Main Camera
Setup LeapMotion VR Scene• From LeapMotion>Prefabs>HandModelsNonhuman drag a
CapsuleHand_L and a CapsuleHand_R to your scene and make them children of the Leap Hand Controller
Setup LeapMotion VR Scene• From LeapMotion>Prefabs>HandModelsPhysical drag a
RigidRoundHand_L and a RigidRoundHand_R to your scene and make them children of the Leap Hand Controller
Setup LeapMotion VR Scene• Locate the HandPool component attached to the LeapHandController• Set Model Collection value to 2 – drag capsuleHands(L/R) and
RigidRoundHands(L/R) from Hierarchy to empty slots• Click Is Enabled and Can Duplicate on both Elements
Setup LeapMotion VR Scene• Add a Directional Light source to your scene• Add a cube and plane to your scene• Adjust positions, scales and rotations relative to your camera• Press play – If everything is working you should see your cube and hands
when you bring them upto the leap motion camera
Setup LeapMotion VR Scene• Select the Cube in the Hierarchy and Add a Rigidbody• Create a new contrasting material and add to your cube• Press play You can now hold the cube in your hand
using the inbuilt Unity Physics Engine
Optimising for Framerates & Quality• Select Project Settings – Quality• Select Simple and change Anti
Aliasing to 4x Multi Sampling• Anti Aliasing is very important in
VR and where possible should be enabled
• Increase Default Render Scale from 1.0 to 1.5 which increases object sharpness – see next slide
• Avoid Dynamic Lighting where possible – best to bake lights
How to Increase Render Scale• Create new C# file called RenderScale• Add the following code and attach script to the LeapSpace Object in your
Hierarchy• Code is from Unity Getting Started Tutorial - http://tinyurl.com/j2elrjt
Final Scene
https://dl.dropboxusercontent.com/u/9011716/LEAPDEMO.zip