(compose position euler-or-quaternion scale)
Sets this matrix to the transformation composed of position, quaternion and scale.
Sets this matrix to the transformation composed of position, quaternion and scale.
(from-col-seq sq)
Sets the elements of this matrix based on an array in column-major format.
Sets the elements of this matrix based on an array in column-major format.
(from-row-seq sq)
Set the elements of this matrix to the supplied row-major values n11, n12, ... n44.
Set the elements of this matrix to the supplied row-major values n11, n12, ... n44.
(identity-matrix4)
Resets this matrix to the identity matrix.
Resets this matrix to the identity matrix.
(invert m)
Inverts this matrix, using the analytic method. You can not invert with a determinant of zero. If you attempt this, the method produces a zero matrix instead.
Inverts this matrix, using the analytic method. You can not invert with a determinant of zero. If you attempt this, the method produces a zero matrix instead.
(decompose m)
Decomposes this matrix into it's position, quaternion and scale components.
Decomposes this matrix into it's position, quaternion and scale components.
(set-position m v)
Sets the position component for this matrix from vector v, without affecting the rest of the matrix - i.e. if the matrix is currently:
Sets the position component for this matrix from vector v, without affecting the rest of the matrix - i.e. if the matrix is currently:
(scale m v)
Multiplies the columns of this matrix by vector v.
Multiplies the columns of this matrix by vector v.
(extract-rotation m)
Extracts the rotation component of the supplied matrix m into this matrix's rotation component.
Extracts the rotation component of the supplied matrix m into this matrix's rotation component.
(transpose m1)
Transposes this matrix.
Transposes this matrix.
(almost-equals m1 m2)
Return true if this matrix and m are almost equal. every element is less than 0.000001.
Return true if this matrix and m are almost equal. every element is less than 0.000001.
(determinant m)
Computes and returns the determinant of this matrix.
Computes and returns the determinant of this matrix.
(equals m1 m2)
Return true if this matrix and m are equal.
Return true if this matrix and m are equal.
(clone' m)
Creates a new Matrix4 and with identical elements to this one.
Creates a new Matrix4 and with identical elements to this one.
(translate m v)
Sets the position component for this matrix from vector v,
Sets the position component for this matrix from vector v,
(multiply m1 m2)
Sets this matrix to m1 * m2.
Sets this matrix to m1 * m2.
(make-basis x-axis y-axis z-axis)
Set this to the basis matrix consisting of the three provided basis vectors: xAxis.x, yAxis.x, zAxis.x, 0, xAxis.y, yAxis.y, zAxis.y, 0, xAxis.z, yAxis.z, zAxis.z, 0, 0, 0, 0, 1
Set this to the basis matrix consisting of the three provided basis vectors: xAxis.x, yAxis.x, zAxis.x, 0, xAxis.y, yAxis.y, zAxis.y, 0, xAxis.z, yAxis.z, zAxis.z, 0, 0, 0, 0, 1
(make-rotation-axis axis theta)
axis — Rotation axis, should be normalized. theta — Rotation angle in radians.
axis — Rotation axis, should be normalized. theta — Rotation angle in radians.
(make-rotation-from-euler e)
Sets the rotation component (the upper left 3x3 matrix) of this matrix to the rotation specified by the given Euler Angle. The rest of the matrix is set to the identity. Depending on the order of the euler, there are six possible outcomes. See this page for a complete list.
Sets the rotation component (the upper left 3x3 matrix) of this matrix to the rotation specified by the given Euler Angle. The rest of the matrix is set to the identity. Depending on the order of the euler, there are six possible outcomes. See this page for a complete list.
(make-rotation-from-quaternion q)
Sets the rotation component of this matrix to the rotation specified by q, as outlined here. The rest of the matrix is set to the identity. So, given q = w + xi + yj + zk, the resulting matrix will be: 1-2y²-2z² 2xy-2zw 2xz+2yw 0 2xy+2zw 1-2x²-2z² 2yz-2xw 0 2xz-2yw 2yz+2xw 1-2x²-2y² 0 0 0 0 1
Sets the rotation component of this matrix to the rotation specified by q, as outlined here. The rest of the matrix is set to the identity. So, given q = w + xi + yj + zk, the resulting matrix will be: 1-2y²-2z² 2xy-2zw 2xz+2yw 0 2xy+2zw 1-2x²-2z² 2yz-2xw 0 2xz-2yw 2yz+2xw 1-2x²-2y² 0 0 0 0 1
(make-rotation-x theta)
theta — Rotation angle in radians.
Sets this matrix as a rotational transformation around the X axis by theta (θ) radians. The resulting matrix will be: 1 0 0 0 0 cos(θ) -sin(θ) 0 0 sin(θ) cos(θ) 0 0 0 0 1
theta — Rotation angle in radians. Sets this matrix as a rotational transformation around the X axis by theta (θ) radians. The resulting matrix will be: 1 0 0 0 0 cos(θ) -sin(θ) 0 0 sin(θ) cos(θ) 0 0 0 0 1
(make-rotation-y theta)
theta — Rotation angle in radians.
Sets this matrix as a rotational transformation around the Y axis by theta (θ) radians. The resulting matrix will be: cos(θ) 0 sin(θ) 0 0 1 0 0 -sin(θ) 0 cos(θ) 0 0 0 0 1
theta — Rotation angle in radians. Sets this matrix as a rotational transformation around the Y axis by theta (θ) radians. The resulting matrix will be: cos(θ) 0 sin(θ) 0 0 1 0 0 -sin(θ) 0 cos(θ) 0 0 0 0 1
(make-rotation-z theta)
theta — Rotation angle in radians.
Sets this matrix as a rotational transformation around the Z axis by theta (θ) radians. The resulting matrix will be: cos(θ) -sin(θ) 0 0 sin(θ) cos(θ) 0 0 0 0 1 0 0 0 0 1
theta — Rotation angle in radians. Sets this matrix as a rotational transformation around the Z axis by theta (θ) radians. The resulting matrix will be: cos(θ) -sin(θ) 0 0 sin(θ) cos(θ) 0 0 0 0 1 0 0 0 0 1
(make-scale x y z)
x - the amount to scale in the X axis. y - the amount to scale in the Y axis. z - the amount to scale in the Z axis.
Sets this matrix as scale transform: x, 0, 0, 0, 0, y, 0, 0, 0, 0, z, 0, 0, 0, 0, 1
x - the amount to scale in the X axis. y - the amount to scale in the Y axis. z - the amount to scale in the Z axis. Sets this matrix as scale transform: x, 0, 0, 0, 0, y, 0, 0, 0, 0, z, 0, 0, 0, 0, 1
(make-shear x y z)
xy - the amount to shear X by Y. xz - the amount to shear X by Z. yx - the amount to shear Y by X. yz - the amount to shear Y by Z. zx - the amount to shear Z by X. zy - the amount to shear Z by Y.
Sets this matrix as a shear transform: 1, yx, zx, 0, xy, 1, zy, 0, xz, yz, 1, 0, 0, 0, 0, 1
xy - the amount to shear X by Y. xz - the amount to shear X by Z. yx - the amount to shear Y by X. yz - the amount to shear Y by Z. zx - the amount to shear Z by X. zy - the amount to shear Z by Y. Sets this matrix as a shear transform: 1, yx, zx, 0, xy, 1, zy, 0, xz, yz, 1, 0, 0, 0, 0, 1
(make-translation x y z)
x - the amount to translate in the X axis. y - the amount to translate in the Y axis. z - the amount to translate in the Z axis.
Sets this matrix as a translation transform: 1, 0, 0, x, 0, 1, 0, y, 0, 0, 1, z, 0, 0, 0, 1
x - the amount to translate in the X axis. y - the amount to translate in the Y axis. z - the amount to translate in the Z axis. Sets this matrix as a translation transform: 1, 0, 0, x, 0, 1, 0, y, 0, 0, 1, z, 0, 0, 0, 1
(matrix4)
(matrix4 sq)
Constructor Matrix4() Creates and initializes the Matrix4 to the 4x4 identity matrix.
Constructor Matrix4() Creates and initializes the Matrix4 to the 4x4 identity matrix.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close