Skip to content

Instantly share code, notes, and snippets.

@diasbruno
Created May 8, 2012 02:15
Show Gist options
  • Save diasbruno/2632038 to your computer and use it in GitHub Desktop.
Save diasbruno/2632038 to your computer and use it in GitHub Desktop.
perspective to frustum
perspectiveToFrustum( fov, aspectRatio, near, far ) {
tangent = tan( fov/2 * PI / 180 )
height = near * tangent
width = height * aspectRatio
frustum( (left = -width), (right = width), (bottom = -height), (top = height), near, far )
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment