Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ousttrue/rowmath
zig math library for 3D graphics, row major
https://github.com/ousttrue/rowmath
raylib sokol wasm zig
Last synced: about 1 month ago
JSON representation
zig math library for 3D graphics, row major
- Host: GitHub
- URL: https://github.com/ousttrue/rowmath
- Owner: ousttrue
- License: mit
- Created: 2024-08-14T13:45:18.000Z (3 months ago)
- Default Branch: master
- Last Pushed: 2024-09-22T03:29:35.000Z (about 2 months ago)
- Last Synced: 2024-10-02T07:04:18.073Z (about 2 months ago)
- Topics: raylib, sokol, wasm, zig
- Language: Zig
- Homepage: https://ousttrue.github.io/rowmath/
- Size: 719 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# rowmath
zig math library for 3D graphics, row major
## note
rowmath は `横vec` + `row major` です。
| mul order | memory layout | impl |
| ----------- | --------------------------- | ------------------------------------- |
| 横vec x mvp | row major(m00, m01, m02...) | rowmath, DirectXMath, System.Numerics |
| pvm x 縦vec | col major(m00, m10, m20...) | glm, UnityEngine |- 一般的な数学書やOpenGLドキュメントは縦vec方式
- 書籍:実例で学ぶゲーム3D数学 は横vec + row 方式
- 4x3(3x4)行列を使う場合は transpose して最後の4要素を落とす結果として Mat4 のメモリ上の内容は同じ(transpose の transpose は同じ)になる。
双方ともに `(m12, m13, m14)` に translation が格納される。乗算順(local x parent x root x view x projection)の左右が異なる。
### 命名
- fromVec3, makeRotation(static 関数)
- toRotation, transformPoint(member 関数)
- add, mul, sub, eq, dot, cross## examples
### sokol
### raylib