projection

package
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 15, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultOrthographic = Ortho(1, 1, 1, 100)

DefaultOrthographic is the default projection matrix using Ortho.

View Source
var DefaultPerspective = Frustum(1, 1, 1, 100)

DefaultPerspective is the default projection matrix using Frustum.

Functions

func Frustum

func Frustum(r, t, n, f float64) matrix.Matrix

Frustum will return a matrix capabable of projecting points inside the cube specified by l,r,b,t,n,f = -r,r,-t,t,-n,-f to clip coordinates. For all valid (non clipped) coordinates the following condition holds: -wc < xc,yc,zc < wc All coordinates for which this condition doesn't hold need to be clipped. To get from clip space coordinates to native device coordinates divide the xc,yc,zc by wc. So xn,yn,zn = xc/wc,yc/wc,zc/wc will give coordinates in de range [-1,1]. These need to be mapped via a viewport to screen coordinates.

func Ortho

func Ortho(r, t, n, f float64) matrix.Matrix

func Perspective

func Perspective(fovy, aspect, near, far float64) matrix.Matrix

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL