Quaternion.AngleAxis 角轴

static function AngleAxis (angle : float, axis : Vector3) : Quaternion

Description描述

Creates a rotation which rotates angle degrees around axis.

绕axis轴旋转angle,创建一个旋转。

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	public void Awake() {
		transform.rotation = Quaternion.AngleAxis(30, Vector3.up);
	}
}
// Sets the transforms rotation to rotate 30 degrees around the y-axis
//设置变换的旋转,绕y轴旋转30度

transform.rotation = Quaternion.AngleAxis(30, Vector3.up);
Page last updated: 2011-1-16