diff options
-rw-r--r-- | libdimension/dimension/geometry.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libdimension/dimension/geometry.h b/libdimension/dimension/geometry.h index 59fb285..d2479f3 100644 --- a/libdimension/dimension/geometry.h +++ b/libdimension/dimension/geometry.h @@ -159,6 +159,17 @@ dmnsn_new_matrix(double a0, double a1, double a2, double a3, return m; } +/** Construct a new transformation matrix from column vectors. */ +DMNSN_INLINE dmnsn_matrix +dmnsn_new_matrix4(dmnsn_vector a, dmnsn_vector b, dmnsn_vector c, + dmnsn_vector d) +{ + dmnsn_matrix m = { { { a.x, b.x, c.x, d.x }, + { a.y, b.y, c.y, d.y }, + { a.z, b.z, c.z, d.z } } }; + return m; +} + /** Return the identity matrix. */ dmnsn_matrix dmnsn_identity_matrix(void); |