- Home /
Question by
martinevil · Apr 12, 2012 at 12:03 PM ·
geometryfrustrum
GeometryUtility.CalculateFrustumPlanes and orthographic camera
Hi, I need to know(*) the planes of the frustrum of a orthographic camera:
planes = GeometryUtility.CalculateFrustumPlanes(orthoCam);
To view the result I do:
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);
p.transform.localScale = Vector3.one * 20.0f;
i++;
}
All planes match the visual representation of the frustrum in the editor, except left and right planes. Any clues?
Thank you!
(*): Trust me.
Comment