Skip to content

Instantly share code, notes, and snippets.

@coastwise
Created July 8, 2013 18:33
Show Gist options
  • Select an option

  • Save coastwise/5951291 to your computer and use it in GitHub Desktop.

Select an option

Save coastwise/5951291 to your computer and use it in GitHub Desktop.

Revisions

  1. coastwise created this gist Jul 8, 2013.
    3 changes: 3 additions & 0 deletions gistfile1.cs
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    float vFOVInRads = Camera.main.fieldOfView * Mathf.Deg2Rad;
    float hFOVInRads = 2 * Mathf.Atan( Mathf.Tan(vFOVInRads / 2) * Camera.main.aspect);
    float hFOV = hFOVInRads * Mathf.Rad2Deg;