Version: 5.3 (switch to 5.4b)
言語English
  • C#
  • JS

スクリプト言語

好きな言語を選択してください。選択した言語でスクリプトコードが表示されます。

GeometryUtility.CalculateFrustumPlanes

フィードバック

ありがとうございます

この度はドキュメントの品質向上のためにご意見・ご要望をお寄せいただき、誠にありがとうございます。頂いた内容をドキュメントチームで確認し、必要に応じて修正を致します。

閉じる

送信に失敗しました

なんらかのエラーが発生したため送信が出来ませんでした。しばらく経ってから<a>もう一度送信</a>してください。ドキュメントの品質向上のために時間を割いて頂き誠にありがとうございます。

閉じる

キャンセル

マニュアルに切り替える
public static function CalculateFrustumPlanes(camera: Camera): Plane[];
public static Plane[] CalculateFrustumPlanes(Camera camera);

パラメーター

説明

錐台平面を計算します

この関数では、カメラの View Frustum を指定するとそれを構成する六つの平面 を返します。

See Also: Plane, GeometryUtility.TestPlanesAABB.

	// Creates 6 planes that represent the camera frustum.

private var cam : Camera; private var planes : Plane[];

function Start() { cam = Camera.main; planes = GeometryUtility.CalculateFrustumPlanes(cam);

for(var i : int = 0; i < planes.Length; i++) { var p : GameObject = GameObject.CreatePrimitive(PrimitiveType.Plane); p.name = "Plane " + i.ToString(); p.transform.position = -planes[i].normal * planes[i].distance; p.transform.rotation = Quaternion.FromToRotation(Vector3.up, planes[i].normal); } }
using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { private Camera cam; private Plane[] planes; void Start() { cam = Camera.main; planes = GeometryUtility.CalculateFrustumPlanes(cam); int i = 0; while (i < planes.Length) { GameObject p = GameObject.CreatePrimitive(PrimitiveType.Plane); p.name = "Plane " + i.ToString(); p.transform.position = -planes[i].normal * planes[i].distance; p.transform.rotation = Quaternion.FromToRotation(Vector3.up, planes[i].normal); i++; } } }

public static function CalculateFrustumPlanes(worldToProjectionMatrix: Matrix4x4): Plane[];
public static Plane[] CalculateFrustumPlanes(Matrix4x4 worldToProjectionMatrix);

パラメーター

説明

錐台平面を計算します

この関数では、カメラの View や投影マトリクスを指定するとそれを構成する六つの平面を返します。

See Also: Plane, GeometryUtility.TestPlanesAABB.