Liking cljdoc? Tell your friends :D

thi.ng.geom.core.matrix


frustumclj/s

(frustum l t r b n f)

Sets up a viewing frustum, shaped like a truncated pyramid with the camera where the tip of the pyramid would be. This emulates the OpenGL function glFrustum().

Sets up a viewing frustum, shaped like a truncated pyramid with the
camera where the tip of the pyramid would be.
This emulates the OpenGL function glFrustum().
raw docstring

frustum-boundsclj/s

(frustum-bounds fovy aspect near)

Given vertical FOV in degrees, aspect ratio and near plane distance, computes map of left/right/top/bottom view frustum bounds.

Given vertical FOV in degrees, aspect ratio and near plane
distance, computes map of left/right/top/bottom view frustum
bounds.
raw docstring

frustum-planesclj/s

(frustum-planes view proj)

Given a view matrix & projection matrix, returns vector of the frustum's 6 plane parameters, each a 2-element vector: [normal w] Planes are ordered: left, right, top, bottom, near, far. These coefficients can then (for example) be used for AABB-frustum culling with thi.nggeom.core.intersect/intersect-aabb-frustum?

Given a view matrix & projection matrix, returns vector of the
frustum's 6 plane parameters, each a 2-element vector: [normal w]
Planes are ordered: left, right, top, bottom, near, far. These
coefficients can then (for example) be used for AABB-frustum culling
with thi.nggeom.core.intersect/intersect-aabb-frustum?
raw docstring

look-atclj/s

(look-at eye target up)

Returns a matrix that puts the camera at the eye position looking toward the target point with the given up direction.

Returns a matrix that puts the camera at the eye position looking
toward the target point with the given up direction.
raw docstring

look-at-vectorsclj/s

(look-at-vectors ex ey ez tx ty tz)

Takes 6 numbers representing eye & target positions, computes up vector and returns vector of all three vec3's.

Takes 6 numbers representing eye & target positions, computes up
vector and returns vector of all three vec3's.
raw docstring

M32clj/s


M44clj/s


Matrix32cljs


matrix32clj/s

(matrix32)
(matrix32 [m00 m01 m02 m10 m11 m12])
(matrix32 m00 m01 m02 m10 m11 m12)

matrix44clj/s

(matrix44)
(matrix44 [m00 m01 m02 m03 m10 m11 m12 m13 m20 m21 m22 m23 m30 m31 m32 m33])
(matrix44 m00 m01 m02 m03 m10 m11 m12 m13 m20 m21 m22 m23 m30 m31 m32 m33)

Matrix44cljs


matrix44->matrix33clj/s

(matrix44->matrix33 [m00 m01 m02 _ m10 m11 m12 _ m20 m21 m22])

matrix44->matrix33-rotclj/s

(matrix44->matrix33-rot [m00 m01 m02 _ m10 m11 m12 _ m20 m21 m22])

orthoclj/s

(ortho l t r b n f)

Returns an orthographic projection matrix, in which objects are the same size no matter how far away or nearby they are. This emulates the OpenGL function glOrtho().

Returns an orthographic projection matrix, in which objects are the
same size no matter how far away or nearby they are. This emulates
the OpenGL function glOrtho().
raw docstring

perspectiveclj/s

(perspective fovy aspect near far)

Returns a perspective transform matrix, which makes far away objects appear smaller than nearby objects. The aspect argument should be the width divided by the height of your viewport and fov is the vertical angle of the field of view in degrees.

Returns a perspective transform matrix, which makes far away objects appear
smaller than nearby objects. The `aspect` argument should be the width
divided by the height of your viewport and `fov` is the vertical angle
of the field of view in degrees.
raw docstring

perspective-frustumclj/s

(perspective-frustum fov aspect near far)

project-pointclj/s

(project-point p mvp vtx)

Projects 3D point p using MVP matrix into 2D and the applies viewport matrix to produce screen coordinate.

Projects 3D point p using MVP matrix into 2D and the applies
viewport matrix to produce screen coordinate.
raw docstring

project-point-zclj/s

(project-point-z p mvp vtx)

Like project-point, but returns vec3 with z component representing depth value.

Like project-point, but returns vec3 with z component representing
depth value.
raw docstring

unproject-pointclj/s

(unproject-point p inv-mat {[vx vy] :p [w h] :size})
(unproject-point p view proj screen-rect)
(unproject-point [x y z] inv-mat vx vy w h)

Takes a vec3 in screenspace, view matrix, projection matrix and screen rect. A second arity exists accepting an already inverted view-projection matrix instead of having to supply view & proj separately. Returns vector in world space or nil if matrix is not invertible.

Takes a vec3 in screenspace, view matrix, projection matrix and
screen rect. A second arity exists accepting an already inverted
view-projection matrix instead of having to supply view & proj
separately. Returns vector in world space or nil if matrix is not
invertible.
raw docstring

viewport-matrixclj/s

(viewport-matrix width height)
(viewport-matrix width height invert-y?)

Given viewport width/height, computes a 2D transformation matrix mapping normalized coordinates to screen space. If invert-y? is true, the Y axis is flipped.

Given viewport width/height, computes a 2D transformation matrix
mapping normalized coordinates to screen space. If invert-y? is
true, the Y axis is flipped.
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close