Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ungerik/go3d
A performance oriented 2D/3D math package for Go
https://github.com/ungerik/go3d
Last synced: about 1 month ago
JSON representation
A performance oriented 2D/3D math package for Go
- Host: GitHub
- URL: https://github.com/ungerik/go3d
- Owner: ungerik
- License: mit
- Created: 2011-06-27T13:02:26.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2022-04-04T20:16:13.000Z (about 2 years ago)
- Last Synced: 2024-01-30T04:48:46.309Z (4 months ago)
- Language: Go
- Homepage:
- Size: 239 KB
- Stars: 284
- Watchers: 11
- Forks: 47
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Lists
- awesome-go - go3d - Performance oriented 2D/3D math package for Go. (Game Development / Search and Analytic Databases)
- awesome-go - go3d - Performance oriented 2D/3D math package for Go. (Game Development / Search and Analytic Databases)
- awesome-go-extra - go3d - 06-27T13:02:26Z|2022-04-04T20:16:13Z| (Game Development / Advanced Console UIs)
- awesome-go - go3d - Performance oriented 2D/3D math package for Go. (Game Development / Search and Analytic Databases)
- awesome-go - go3d - Performance oriented 2D/3D math package for Go. (Game Development / Advanced Console UIs)
- fucking-awesome-go - :octocat: go3d - A performance oriented 2D/3D math package for Go :star: 106 :fork_and_knife: 12 (Game Development / Advanced Console UIs)
- awesome-go - go3d - Performance oriented 2D/3D math package for Go. (Game Development / Advanced Console UIs)
- awesome-go-projects - go3d - Performance oriented 2D/3D math package for Go. (Game Development / Standard CLI)
- awesome-go - go3d - Performance oriented 2D/3D math package for Go. (Game Development / Search and Analytic Databases)
- awesome-go - go3d - | - | - | (Game Development / Advanced Console UIs)
- awesome-go - go3d - A performance oriented 2D/3D math package for Go (Game Development / Advanced Console UIs)
- awesome-go-with-framework - go3d - Performance oriented 2D/3D math package for Go. (Game Development / Advanced Console UIs)
- awesome-go - go3d - Performance oriented 2D/3D math package for Go. (Game Development / Search and Analytic Databases)
- awesome-go-cn - go3d
- awesome-go-zh - go3d
- awesome-go - go3d - A performance oriented 2D/3D math package for Go (Game Development / Advanced Console UIs)
- awesome-go - go3d - Performance oriented 2D/3D math package for Go. (Game Development / Advanced Console UIs)
- awesome-go - go3d - 面向Go的面向性能的2D / 3D数学包。 (<span id="游戏开发-game-development">游戏开发 Game Development</span> / <span id="高级控制台用户界面-advanced-console-uis">高级控制台用户界面 Advanced Console UIs</span>)
- awesome-go. - go3d - Performance oriented 2D/3D math package for Go. (Game Development / Advanced Console UIs)
- awesome-go-with-stars - go3d - Performance oriented 2D/3D math package for Go. (Game Development / Search and Analytic Databases)
- awesome-go - go3d - Performance oriented 2D/3D math package for Go. (Game Development / Advanced Console UIs)
- repo-1316-awesome-go-cn - go3d
- repo-1211-awesome-go-cn - go3d
- awesome-Char - go3d - Performance oriented 2D/3D math package for Go. (Game Development / Advanced Console UIs)
- awesome-reader - go3d - Performance oriented 2D/3D math package for Go. (Game Development / Advanced Console UIs)
- awesome-go - go3d - Performance oriented 2D/3D math package for Go. (Game Development / Advanced Console UIs)
- Go-awesome - go3d - Performance oriented 2D/3D math package for Go. (Game Development / Search and Analytic Databases)
- awesome-go - go3d - A performance oriented 2D/3D math package for Go (Game Development / Advanced Console UIs)
- awesome-go-cn - go3d
- awesome-go-handwritten - go3d - Performance oriented 2D/3D math package for Go. (Game Development / Advanced Console UIs)
- awesome-go2 - go3d - Performance oriented 2D/3D math package for Go. (Game Development / Advanced Console UIs)
- awesome-go - go3d - A performance oriented 2D/3D math package for Go (Game Development / Advanced Console UIs)
- awesome-go - go3d - Performance oriented 2D/3D math package for Go. (Game Development / Advanced Console UIs)
- awesome-go - go3d - Performance oriented 2D/3D math package for Go. - :arrow_down:0 - :star:112 (Game Development / Advanced Console UIs)
- awesome-go - go3d - Performance oriented 2D/3D math package for Go. (Game Development / Search and Analytic Databases)
- awesome-go - go3d - Performance oriented 2D/3D math package for Go. (Game Development / Advanced Console UIs)
- awesome-go-cn - go3d
- awesome-go-stars - go3d(stars: 288) - Performance oriented 2D/3D math package for Go. (Game Development / Search and Analytic Databases)
- awesome-go-cn - go3d
- awesome-go - go3d - Performance oriented 2D/3D math package for Go. (Game Development / Search and Analytic Databases)
- awesome-go - go3d - Performance oriented 2D/3D math package for Go. (Game Development / Search and Analytic Databases)
- go-awesome-cn-star - go3d
- awesome-go-cn - go3d
- awesome-go - go3d - A performance oriented 2D/3D math package for Go - ★ 142 (Game Development)
- my-awesome - ungerik/go3d - 05 star:0.3k fork:0.0k A performance oriented 2D/3D math package for Go (Go)
README
Package go3d is a performance oriented vector and matrix math package for 2D and 3D graphics.
Every type has its own sub-package and is named T. So vec3.T is the 3D vector type.
For every vector and matrix type there is a String() method and a Parse() function.
Besides methods of T there are also functions in the packages, like vec3.Dot(a, b).Packages under the float64 directory are using float64 values instead of float32.
Matrices are organized as arrays of columns which is also the way OpenGL expects matrices.
DirectX expects "arrays of rows" matrices, use the Transpose() to convert.Methods that don't return a specific value, return a pointer to the struct to allow method call chaining.
Example:
a := vec3.Zero
b := vec3.UnitX
a.Add(&b).Scale(5)Method names in the past tense return a copy of the struct instead of a pointer to it.
Example:
a := vec3.UnitX
b := a.Scaled(5) // a still equals vec3.UnitXNote that the package is designed for performance over usability where necessary.
This is the reason why many arguments are passed by pointer reference instead of by value.
Sticking either to passing and returning everything by value or by pointer
would lead to a nicer API, but it would be slower as demonstrated in mat4/mat4_test.gocd mat4
go test -bench=BenchmarkMulAddVec4_PassBy*Documentation: https://pkg.go.dev/github.com/ungerik/go3d