RSS

Setting camera projection of Unity3D given FOV and aspect ratio

23 Apr

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: ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: