Quantcast
Channel: iOS and tvOS
Viewing all articles
Browse latest Browse all 10823

[Sharing] Gyroscope Camera Script (iOS tested)

$
0
0
Hey guys, I got a bit obsessed with understanding exactly how to adjust the quaternion in Input.gyro.attitude to work as a good camera rotation. I never did really grasp quaternions as I hoped but I have created a gyro camera script that I think may be helpful to others. Here it is!

Code (csharp):
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class GyroCamera : MonoBehaviour
  5. {
  6.     private float initialYAngle = 0f;
  7.     private float appliedGyroYAngle = 0f;
  8.     private float calibrationYAngle =...
[Sharing] Gyroscope Camera Script (iOS tested)

Viewing all articles
Browse latest Browse all 10823

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>