Created
December 18, 2017 09:43
-
-
Save keijiro/cac2a218833805d04e159587898fe097 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 SetRotation : MonoBehaviour { public Material material; public void Set(Vector3 r) { var q = Quaternion.Euler(r.x, r.y, r.z); var m = Matrix4x4.TRS(Vector3.zero, q, Vector3.one); material.SetVector("_Rotation1", m.GetRow(0)); material.SetVector("_Rotation2", m.GetRow(1)); material.SetVector("_Rotation3", m.GetRow(2)); } } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment