gonutz / d3dmath

Go library for matrix and vector manipulation, suited for Direct3D (row-major ordering).

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Package d3dmath provides vector and matrix functions similar to those in D3DX, a helper library for doing 3D graphics maths.

It is designed to work well with d3d9.

Matrices are layed out in row-major order, meaning a matrix defined as:

Mat4 {
	 1,  2,  3,  4,
	 5,  6,  7,  8,
	 9, 10, 11, 12,
	13, 14, 15, 16,
}

represents the matrix you would expect by reading the source code, i.e.:

 1  2  3  4
 5  6  7  8
 9 10 11 12
13 14 15 16

Vectors are row-vectors, so the vector:

Vec3{1, 2, 3}

is the vector:

1 2 3

and not the vector:

1
2    <- not this
3

Functions that work with view transformations, like LookAt or Perspective assume a left-handed coordinate system.

About

Go library for matrix and vector manipulation, suited for Direct3D (row-major ordering).

License:MIT License


Languages

Language:Go 100.0%