言語: 日本語
  • C#
  • JS
  • Boo

スクリプト言語

お好みのスクリプト言語を選択すると、サンプルコードがその言語で表示されます。

Mesh.normals

public var normals: Vector3[];

Description

メッシュの法線

If the mesh contains no normals an empty array will be returned.

	// Rotate the normals by speed every frame

	var speed = 100.0;

	function Update () {
		var mesh : Mesh = GetComponent(MeshFilter).mesh;
		var normals : Vector3[] = mesh.normals;

		var rotation : Quaternion = Quaternion.AngleAxis(Time.deltaTime * speed, Vector3.up);
		for (var i = 0; i < normals.Length; i++)
			normals[i] = rotation * normals[i];

		mesh.normals = normals;
	}