Documentation ¶
Overview ¶
Package space implements mathematical objets and operations in three-dimensional euclidean space.
Index ¶
- func Apply(m Matrix, v coord.XYZW) coord.XYZW
- type Matrix
- func EulerXYZ(angleX, angleY, angleZ float32) Matrix
- func EulerXZY(angleX, angleY, angleZ float32) Matrix
- func EulerYXZ(angleX, angleY, angleZ float32) Matrix
- func EulerYZX(angleX, angleY, angleZ float32) Matrix
- func EulerZXY(angleX, angleY, angleZ float32) Matrix
- func EulerZYX(angleX, angleY, angleZ float32) Matrix
- func Identity() Matrix
- func LookAt(eye, target, up coord.XYZ) Matrix
- func Orthographic(zoom, aspectRatio, near, far float32) Matrix
- func OrthographicFrustum(left, right, bottom, top, near, far float32) Matrix
- func Perspective(fieldOfView, aspectRatio, near, far float32) Matrix
- func PerspectiveFrustum(left, right, bottom, top, near, far float32) Matrix
- func Rotation(angle float32, axis coord.XYZ) Matrix
- func Scaling(s coord.XYZ) Matrix
- func Translation(t coord.XYZ) Matrix
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Matrix ¶
type Matrix [4][4]float32
Matrix represents a transformation matrix.
func EulerXYZ ¶
EulerXYZ returns a transformation matrix corresponding to a sequence of three intrinsic rotations around the (local) axis X, Y, Z, in that order.
func EulerXZY ¶
EulerXZY returns a transformation matrix corresponding to a sequence of three intrinsic rotations around the (local) axis X, Z, Y, in that order.
func EulerYXZ ¶
EulerYXZ returns a transformation matrix corresponding to a sequence of three intrinsic rotations around the (local) axis Y, X, Z, in that order.
func EulerYZX ¶
EulerYZX returns a transformation matrix corresponding to a sequence of three intrinsic rotations around the (local) axis Y, Z, X, in that order.
func EulerZXY ¶
EulerZXY returns a transformation matrix corresponding to a sequence of three intrinsic rotations around the (local) axis Z, X, Y, in that order.
func EulerZYX ¶
EulerZYX returns a transformation matrix corresponding to a sequence of three intrinsic rotations around the (local) axis Z, Y, X, in that order.
func LookAt ¶
LookAt returns a transformation matrix which put eye at origin and target along negative Z. In other words, if a projection matrix is applied to the result, target will be in the center of the viewport.
func Orthographic ¶
Orthographic returns an orthographic (parallel) projection matrix. (zoom is the height of the projection plane).
func OrthographicFrustum ¶
OrthographicFrustum returns an orthographic (parallel) projection matrix.
func Perspective ¶
Perspective returns a perspective projection matrix.
func PerspectiveFrustum ¶
PerspectiveFrustum returns a perspective projection matrix.
func (Matrix) Translation ¶
Translation returns the translation vector of the transformation matrix.
func (Matrix) WithoutTranslation ¶
WithoutTranslation returns the transformation matrix with the translation part removed.