![[LeapMotion + UniRx] Moving a Camera with Hand Gestures: Two-Hand Edition](/_next/image?url=https%3A%2F%2Fmedia2.dev.to%2Fdynamic%2Fimage%2Fwidth%3D800%252Cheight%3D%252Cfit%3Dscale-down%252Cgravity%3Dauto%252Cformat%3Dauto%2Fhttps%253A%252F%252Fdev-to-uploads.s3.amazonaws.com%252Fuploads%252Farticles%252Fq2t3kaucxoipbg5dqjv1.png&w=1200&q=75)
[LeapMotion + UniRx] Moving a Camera with Hand Gestures: Two-Hand Edition
Introduction In the previous article , I implemented translating the Main Camera using one-hand Leap Motion input when no mouse or keyboard is available. This time, I'm adding rotation and zoom control as well. Demo Here's what I built. I exhibited it at Looking Glass Meetup (Rukimito) . // Detect dark theme var iframe = document.getElementById('tweet-1109754332092624896-397'); if (document.body.className.includes('dark-theme')) { iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=1109754332092624896&theme=dark" } When both hands are in a fist, the camera responds to hand movement with three operations: Scale (zoom in/out) Rotation Translation (pan) Sample Code Here is the full code. It is intended to be attached to the Main Camera . using Leap ; using System.Collections.Generic ; using System.Linq ; using UniRx ; using UniRx.Triggers ; using UnityEngine ; /// <summary> /// Camera controller /// </summary> public class CameraController : MonoBehaviour { /** Camera movement
Continue reading on Dev.to
Opens in a new tab


