Created
May 7, 2020 14:27
-
-
Save TelpeNight/5264494eca24b8ad782e72a700a0fa44 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public class FunkyProjectionMatrix : MonoBehaviour | |
{ | |
public Matrix4x4 originalProjection; | |
Camera cam; | |
void Start() | |
{ | |
cam = GetComponent<Camera>(); | |
originalProjection = cam.projectionMatrix; | |
} | |
void Update() | |
{ | |
Matrix4x4 p = originalProjection; | |
p.m00 += Mathf.Sin(Time.time * 1.1F) * 0.1F; | |
p.m01 += Mathf.Sin(Time.time * 1.2F) * 0.1F; | |
p.m02 += Mathf.Sin(Time.time * 1.3F) * 0.1F; | |
p.m03 += Mathf.Sin(Time.time * 1.4F) * 0.1F; | |
p.m10 += Mathf.Sin(Time.time * 1.5F) * 0.1F; | |
p.m11 += Mathf.Sin(Time.time * 1.6F) * 0.1F; | |
p.m12 += Mathf.Sin(Time.time * 1.7F) * 0.1F; | |
p.m13 += Mathf.Sin(Time.time * 1.8F) * 0.1F; | |
cam.projectionMatrix = p; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment