脚本与 Python API

MQMatrix · 矩阵

本页目录
  1. 方法
  2. get(row, col)
  3. set(row, col, value)
  4. mult(point)
  5. mult3(point)
  6. indentify
  7. transpose
  8. transpose3
  9. getScaling
  10. getRotation
  11. getTranslation
  12. setTransform(scaling, rotation, translation)
  13. setInverseTransform(scaling, rotation, translation)

4×4 矩阵。

方法#

成员 说明
get 获取数值。
set 设置数值。
mult 将向量与矩阵相乘。
mult3 将向量与矩阵相乘。
indentify 将矩阵设为单位矩阵。
transpose 转置矩阵。
transpose3 转置 3×3 矩阵。
getScaling 获取 SRT 变换矩阵的缩放分量。
getRotation 获取 SRT 变换矩阵的旋转角度。
getTranslation 获取 SRT 变换矩阵的平移分量。
setTransform 设置 SRT 变换矩阵。
setInverseTransform 设置 SRT 逆变换矩阵。

get(row, col)#

获取数值。

参数:
int row - 行索引(范围 [1:4])
int col - 列索引(范围 [1:4])
返回值:
float - 值

set(row, col, value)#

设置数值。

参数:
int row - 行索引(范围 [1:4])
int col - 列索引(范围 [1:4])
float value - 值

mult(point)#

将向量与矩阵相乘。

参数:
MQPoint point - 向量
返回值:
MQPoint - 向量

mult3(point)#

将向量与矩阵相乘。

参数:
MQPoint point - 向量
返回值:
MQPoint - 向量

indentify #

将矩阵设为单位矩阵。

transpose #

转置矩阵。

transpose3 #

转置 3×3 矩阵。

getScaling #

获取 SRT 变换矩阵的缩放分量。

返回值:
MQPoint - 缩放系数

getRotation #

获取 SRT 变换矩阵的旋转角度。

返回值:
MQAngle - 旋转角度

getTranslation #

获取 SRT 变换矩阵的平移分量。

返回值:
MQPoint - 缩放系数

setTransform(scaling, rotation, translation)#

设置 SRT 变换矩阵。

参数:
MQPoint scaling - 缩放系数
MQAngle rotation - 旋转角度
MQPoint translation - 平移分量

setInverseTransform(scaling, rotation, translation)#

设置 SRT 逆变换矩阵。

参数:
MQPoint scaling - 缩放系数
MQAngle rotation - 旋转角度
MQPoint translation - 平移分量
输入关键词,查找手册中的内容。