Blender V4.3
blender::math::projection Namespace Reference

Functions

template<typename T >
MatBase< T, 4, 4 > orthographic (T left, T right, T bottom, T top, T near_clip, T far_clip)
 Create an orthographic projection matrix using OpenGL coordinate convention: Maps each axis range to [-1..1] range for all axes. The resulting matrix can be used with either project_point or transform_point.
 
template<typename T >
MatBase< T, 4, 4 > orthographic_infinite (T left, T right, T bottom, T top)
 Create an orthographic projection matrix using OpenGL coordinate convention: Maps each axis range to [-1..1] range for all axes except Z. The Z axis is almost collapsed to 0 which eliminates the depth component. So it should not be used with depth testing. The resulting matrix can be used with either project_point or transform_point.
 
template<typename T >
MatBase< T, 4, 4 > perspective (T left, T right, T bottom, T top, T near_clip, T far_clip)
 Create a perspective projection matrix using OpenGL coordinate convention: Maps each axis range to [-1..1] range for all axes. left, right, bottom, top are frustum side distances at z=near_clip. The resulting matrix can be used with project_point.
 
template<typename T >
MatBase< T, 4, 4 > perspective_fov (T angle_left, T angle_right, T angle_bottom, T angle_top, T near_clip, T far_clip)
 Create a perspective projection matrix using OpenGL coordinate convention: Maps each axis range to [-1..1] range for all axes. Uses field of view angles instead of plane distances. The resulting matrix can be used with project_point.
 
template<typename T >
MatBase< T, 4, 4 > perspective_infinite (T left, T right, T bottom, T top, T near_clip)
 Create a perspective projection matrix using OpenGL coordinate convention: Maps each axis range to [-1..1] range for all axes except for the Z where [near_clip..inf] is mapped to [-1..1]. left, right, bottom, top are frustum side distances at z=near_clip. The resulting matrix can be used with project_point.
 
template<typename T >
MatBase< T, 4, 4 > translate (const MatBase< T, 4, 4 > &mat, const VecBase< T, 2 > &offset)
 Translate a projection matrix after creation in the screen plane. Usually used for anti-aliasing jittering. offset is the translation vector in projected space.
 
template<typename T >
MatBase< T, 4, 4 > orthographic_infinite (T left, T right, T bottom, T top, T near_clip)
 
template float4x4 orthographic (float left, float right, float bottom, float top, float near_clip, float far_clip)
 
template float4x4 perspective (float left, float right, float bottom, float top, float near_clip, float far_clip)
 
template float4x4 perspective_infinite (float left, float right, float bottom, float top, float near_clip)
 

Function Documentation

◆ orthographic() [1/2]

template float4x4 blender::math::projection::orthographic ( float left,
float right,
float bottom,
float top,
float near_clip,
float far_clip )
extern

References orthographic().

◆ orthographic() [2/2]

template<typename T >
MatBase< T, 4, 4 > blender::math::projection::orthographic ( T left,
T right,
T bottom,
T top,
T near_clip,
T far_clip )
nodiscard

Create an orthographic projection matrix using OpenGL coordinate convention: Maps each axis range to [-1..1] range for all axes. The resulting matrix can be used with either project_point or transform_point.

Definition at line 1615 of file BLI_math_matrix.hh.

References blender::MatBase< T, NumCol, NumRow, Alignment >::identity(), left, orthographic(), and T.

Referenced by blender::eevee::VolumeModule::draw_prepass(), orthographic(), orthographic(), blender::eevee::ShadowTileMap::sync_orthographic(), and blender::draw::test_eevee_surfel_list().

◆ orthographic_infinite() [1/2]

template<typename T >
MatBase< T, 4, 4 > blender::math::projection::orthographic_infinite ( T left,
T right,
T bottom,
T top )

Create an orthographic projection matrix using OpenGL coordinate convention: Maps each axis range to [-1..1] range for all axes except Z. The Z axis is almost collapsed to 0 which eliminates the depth component. So it should not be used with depth testing. The resulting matrix can be used with either project_point or transform_point.

Referenced by blender::eevee::VolumeModule::draw_prepass(), orthographic_infinite(), and blender::eevee::LookdevView::render().

◆ orthographic_infinite() [2/2]

template<typename T >
MatBase< T, 4, 4 > blender::math::projection::orthographic_infinite ( T left,
T right,
T bottom,
T top,
T near_clip )

◆ perspective() [1/2]

template float4x4 blender::math::projection::perspective ( float left,
float right,
float bottom,
float top,
float near_clip,
float far_clip )
extern

◆ perspective() [2/2]

template<typename T >
MatBase< T, 4, 4 > blender::math::projection::perspective ( T left,
T right,
T bottom,
T top,
T near_clip,
T far_clip )
nodiscard

Create a perspective projection matrix using OpenGL coordinate convention: Maps each axis range to [-1..1] range for all axes. left, right, bottom, top are frustum side distances at z=near_clip. The resulting matrix can be used with project_point.

Definition at line 1657 of file BLI_math_matrix.hh.

References blender::MatBase< T, NumCol, NumRow, Alignment >::identity(), left, and T.

Referenced by blender::eevee::VolumeModule::draw_prepass(), blender::eevee::CaptureView::render_probes(), blender::eevee::CaptureView::render_world(), blender::eevee::Camera::sync(), blender::eevee::ShadingView::sync(), blender::eevee::ShadowTileMap::sync_cubeface(), blender::tests::TEST(), and blender::draw::test_eevee_shadow_finalize().

◆ perspective_fov()

template<typename T >
MatBase< T, 4, 4 > blender::math::projection::perspective_fov ( T angle_left,
T angle_right,
T angle_bottom,
T angle_top,
T near_clip,
T far_clip )
nodiscard

Create a perspective projection matrix using OpenGL coordinate convention: Maps each axis range to [-1..1] range for all axes. Uses field of view angles instead of plane distances. The resulting matrix can be used with project_point.

Definition at line 1701 of file BLI_math_matrix.hh.

References perspective_fov(), and blender::math::tan().

Referenced by perspective_fov().

◆ perspective_infinite() [1/2]

template float4x4 blender::math::projection::perspective_infinite ( float left,
float right,
float bottom,
float top,
float near_clip )

◆ perspective_infinite() [2/2]

template<typename T >
MatBase< T, 4, 4 > blender::math::projection::perspective_infinite ( T left,
T right,
T bottom,
T top,
T near_clip )
nodiscard

Create a perspective projection matrix using OpenGL coordinate convention: Maps each axis range to [-1..1] range for all axes except for the Z where [near_clip..inf] is mapped to [-1..1]. left, right, bottom, top are frustum side distances at z=near_clip. The resulting matrix can be used with project_point.

Definition at line 1678 of file BLI_math_matrix.hh.

References eps, blender::MatBase< T, NumCol, NumRow, Alignment >::identity(), left, perspective_infinite(), and T.

Referenced by blender::eevee::VolumeModule::draw_prepass(), perspective_infinite(), and perspective_infinite().

◆ translate()

template<typename T >
MatBase< T, 4, 4 > blender::math::projection::translate ( const MatBase< T, 4, 4 > & mat,
const VecBase< T, 2 > & offset )
nodiscard

Translate a projection matrix after creation in the screen plane. Usually used for anti-aliasing jittering. offset is the translation vector in projected space.

Definition at line 1716 of file BLI_math_matrix.hh.

References blender::math::length(), and result.

Referenced by blender::eevee::VolumeModule::draw_prepass().