RSS

Tag Archives: camera projection matrix

Setting camera projection of Unity3D given FOV and aspect ratio

reference : http://forum.unity3d.com/threads/50899-Vertical-FOV-plus-Aspect-Ratio?p=323419&viewfull=1#post323419

  1. var verticalFOV : float = 45;
  2. var forcedAspectRatio: float = 1.6;
  3. var manualNearClipPlane : float = .3;
  4. var manualFarClipPlane : float = 1000;
  5. function Update(){
  6.     camera.projectionMatrix = Matrix4x4.Perspective(verticalFOV, forcedAspectRatio, manualNearClipPlane, manualFarClipPlane);
  7. }
Advertisements
 
Leave a comment

Posted by on April 23, 2014 in Unity3D

 

Tags: ,