Created
April 19, 2019 23:49
-
-
Save gkagm2/1b429e116e4790f12c345c6dd1c62c1f to your computer and use it in GitHub Desktop.
Quaternion
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 System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class csKeyMove : MonoBehaviour { | |
public float a; | |
public float x; | |
// Update is called once per frame | |
void Update () { | |
//Horizontal - Z axis | |
transform.rotation *= Quaternion.AngleAxis(a * 30.0f - 1 * Time.deltaTime, Vector3.forward); //기울일 각 과, 회전할 축 | |
x += Time.deltaTime * 10; | |
transform.rotation = Quaternion.Euler(x, 0.0f, 0.0f); //기울일 각을 오일러로 표현한다. | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment