Matrices

内容表

关于

The matrix classes of the MAXON API are based on these generic matrix templates:

Classes

2D Matrices

maxon::Mat2 based matrices contains these members:

maxon::Mat2 based matrix classes are:

maxon::SqrMat2 based matrix classes are:

3D Matrices

maxon::Mat3 based matrices contains these members:

maxon::Mat3 based matrix classes are:

maxon::SqrMat3 based matrix classes are:

4D Matrices

maxon::SqrMat4 based matrix classes are:

Creation

A new matrix object is simply created using the above matrix classes. It is can easily be configured with SetIdentity():

// This example creates a matrix and prints its data to the debug console.
maxon::Matrix matrix; matrix. SetIdentity ();
DiagnosticOutput ( "V1: @" , matrix. sqmat . v1 ); DiagnosticOutput ( "V2: @" , matrix. sqmat . v2 ); DiagnosticOutput ( "V3: @" , matrix. sqmat . v3 ); DiagnosticOutput ( "Off: @" , matrix. off );

The following operators can be applied to a matrix:

// This example uses the given matrix to transform a point. maxon::Vector point(10, 10, 10);

// apply matrix point = matrix * point; DiagnosticOutput ( "New Point: @" , point);

Further utility functions are:

Special functions of maxon::SqrMat2 , maxon::SqrMat3 and maxon::SqrMat4 are:

Special functions of maxon::SqrMat3 and maxon::SqrMat4 are:

Utility

These utility functions are used to create transformation matrices:

// This example creates a scale matrix and uses it to transform a given point. const maxon::Vector scale(1.0, 10.0, 1.0); maxon::Matrix matrix; matrix. sqmat = maxon::GetScaleMatrix (scale);

// scale point = matrix * point; DiagnosticOutput ( "New Point: @" , point);

延伸阅读

maxon::SqrMat3::v3
V v3
The Z axis.
定义: matrix.h:31
maxon::Mat3< Vector >
maxon::SqrMat3::v1
V v1
The X axis.
定义: matrix.h:25
DiagnosticOutput
#define DiagnosticOutput(formatString,...)
定义: debugdiagnostics.h:166
maxon::Vec3< Float, 1 >
maxon::GetScaleMatrix
SqrMat3< Vec3< FLOAT > > GetScaleMatrix(const Vec3< FLOAT > &scale)
Calculates a matrix to scale.
maxon::Mat3::sqmat
SqrMat3< V > sqmat
The 3×3 matrix for rotation, scale and shear.
定义: matrix.h:282
maxon::Mat3::off
V off
The translation vector.
定义: matrix.h:279
maxon::Mat3::SetIdentity
constexpr void SetIdentity()
Sets this matrix to an identity matrix.
定义: matrix.h:306
maxon::SqrMat3::v2
V v2
The Y axis.
定义: matrix.h:28

Copyright  © 2014-2025 乐数软件    

工业和信息化部: 粤ICP备14079481号-1