Skip to content

Instantly share code, notes, and snippets.

View Chinedu25's full-sized avatar
💭
What the hell is going on?

Gabriel Chinedu25

💭
What the hell is going on?
View GitHub Profile
@Chinedu25
Chinedu25 / GyroCamera.cs
Created July 8, 2021 22:12 — forked from kormyen/GyroCamera.cs
Unity3D script for rotating camera with a phone's gyro. Includes smoothing and initial offset. Edited from https://forum.unity3d.com/threads/sharing-gyroscope-camera-script-ios-tested.241825/
using UnityEngine;
using System.Collections;
public class GyroCamera : MonoBehaviour
{
// STATE
private float _initialYAngle = 0f;
private float _appliedGyroYAngle = 0f;
private float _calibrationYAngle = 0f;
private Transform _rawGyroRotation;
//Self-Signed Certificate for using with VS Code Live Server
//Save both files in a location you will remember
1. create a private key
openssl genrsa -aes256 -out localhost.key 2048
// you will be prompted to provide a password
//this will create localhost.key (call it whatever you like)
2. create the certificate