Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- _forward = normalize(point - position);
- (cos(pitch)cos(yaw), cos(pitch)sin(yaw), sin(pitch))
- float xPos = Mathf.Sin(transform.eulerAngles.y * Mathf.Deg2Rad) * Mathf.Cos(transform.eulerAngles.x * Mathf.Deg2Rad);
- float yPos = Mathf.Sin(-transform.eulerAngles.x * Mathf.Deg2Rad);
- float zPos = Mathf.Cos(transform.eulerAngles.x * Mathf.Deg2Rad) * Mathf.Cos(transform.eulerAngles.y * Mathf.Deg2Rad);
- print(xPos + ", " + yPos + ", " + zPos + ", " + transform.forward);
- https://forum.unity.com/threads/what-is-the-math-behind-calculating-transform-forward-of-an-object.521318/
- https://gamedev.stackexchange.com/questions/90208/how-to-calculate-a-direction-vector-for-camera
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement