Skip to content

Instantly share code, notes, and snippets.

@asus4
Created February 5, 2013 08:57
Show Gist options
  • Save asus4/4713156 to your computer and use it in GitHub Desktop.
Save asus4/4713156 to your computer and use it in GitHub Desktop.
Convert LeapMotion Coordinate system to Unity
using UnityEngine;
namespace Leap {
public class LeapUtil
{
public static Vector3 ToPositionVector3 (Vector position)
{
return new Vector3 (position.x, position.y, -position.z);
}
public static Vector3 ToVector3 (Vector v)
{
return new Vector3 (v.x, v.y, v.z);
}
public static void LookAt (Transform t, Vector norlmal)
{
t.LookAt (t.position + ToPositionVector3 (norlmal), Vector3.forward);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment