# IRdMatrixf Interface Reference

Inherits IUnknown.

List of all members.

## Public Member Functions
HRESULT | LoadIdentity (void)
HRESULT | LockData ([out, retval] RtFloat **pMatrix)
HRESULT | UnlockData (void)
HRESULT | GetAt ([in] RtUlong i,[in] RtUlong j,[out, retval] RtFloat *pVal)
HRESULT | SetAt ([in] RtUlong i,[in] RtUlong j,[in] RtFloat newVal)
HRESULT | RotationAxis ([in] RtFloat x,[in] RtFloat y,[in] RtFloat z,[in] RtFloat angle)
HRESULT | Mult ([in] RtMatrixf *pM)
HRESULT | PreMult ([in] RtMatrixf *pM)
HRESULT | GetAxisX ([out, retval] IRdVertex **ppVect)
HRESULT | GetAxisY ([out, retval] IRdVertex **ppVect)
HRESULT | GetAxisZ ([out, retval] IRdVertex **ppVect)
HRESULT | GetTransX ([out, retval] RtFloat *pVal)
HRESULT | SetTransX ([in] RtFloat newVal)
HRESULT | GetTransY ([out, retval] RtFloat *pVal)
HRESULT | SetTransY ([in] RtFloat newVal)
HRESULT | GetTransZ ([out, retval] RtFloat *pVal)
HRESULT | SetTransZ ([in] RtFloat newVal)
HRESULT | GetRoll ([out, retval] RtFloat *pVal)
HRESULT | SetRoll ([in] RtFloat newVal)
HRESULT | GetPitch ([out, retval] RtFloat *pVal)
HRESULT | SetPitch ([in] RtFloat newVal)
HRESULT | GetYaw ([out, retval] RtFloat *pVal)
HRESULT | SetYaw ([in] RtFloat newVal)
HRESULT | GetScaleX ([out, retval] RtFloat *pVal)
HRESULT | SetScaleX ([in] RtFloat newVal)
HRESULT | GetScaleY ([out, retval] RtFloat *pVal)
HRESULT | SetScaleY ([in] RtFloat newVal)
HRESULT | GetScaleZ ([out, retval] RtFloat *pVal)
HRESULT | SetScaleZ ([in] RtFloat newVal)
HRESULT | GetShearX ([out, retval] RtFloat *pVal)
HRESULT | SetShearX ([in] RtFloat newVal)
HRESULT | GetShearY ([out, retval] RtFloat *pVal)
HRESULT | SetShearY ([in] RtFloat newVal)
HRESULT | GetShearZ ([out, retval] RtFloat *pVal)
HRESULT | SetShearZ ([in] RtFloat newVal)
HRESULT | AddScaleShear ([in] RtFloat sx,[in]RtFloat sy,[in] RtFloat sz,[in] RtFloat sxy,[in] RtFloat sxz,[in] RtFloat syz)
HRESULT | Rotate ([in] IRdVertex *center,[in] IRdVertex *axes,[in] RtFloat angle)
HRESULT | Decompose ([out] RtMatrixf *pM,[out] RtFloat *ss)
HRESULT | Shift ([in] IRdVertex *pShift)
HRESULT | LoadMatrix ([in] RtMatrixf *pM)
HRESULT | Invert ([out] RtMatrixf *pM)
HRESULT | Transpose (RtMatrixf *pM)
HRESULT | ScaleLocal ([in] RtFloat x,[in] RtFloat y,[in] RtFloat z)
HRESULT | Scale ([in] RtFloat x,[in] RtFloat y,[in] RtFloat z)
HRESULT | Shear ([in] RtFloat x,[in] RtFloat y,[in] RtFloat z)
HRESULT | TranslateLocal ([in] RtFloat x,[in] RtFloat y,[in] RtFloat z)
HRESULT | Translate ([in] RtFloat x,[in] RtFloat y,[in] RtFloat z)
HRESULT | RotateEuler ([in] RtFloat x,[in] RtFloat y,[in] RtFloat z)
HRESULT | RotateEulerPRY ([in] RtFloat fPitch,[in] RtFloat fRoll,[in] RtFloat fYaw)
HRESULT | RotationX ([in] RtFloat x)
HRESULT | RotationY ([in] RtFloat y)
HRESULT | RotationZ ([in] RtFloat z)
HRESULT | TransformPoint ([in] RtPoint SourcePoint,[out] RtPoint *pDestPoint)
HRESULT | TransformVector ([in] RtPoint SourceVect,[out] RtPoint *pDestVect)
HRESULT | LookAt ([in] RtVector3f *pEye,[in] RtVector3f *pAt,[in] RtVector3f *pUp)
HRESULT | MakeRotTrans ([in] RtPoint center,[in] RtPoint axis,[in] RtFloat angle)

## Detailed Description

The IRdMatrixf object stores the transformation matrix of size 4x4 that encodes the rotation, scale and translation of an object in space This object is generated for example by object into ObjMatrix connector. The IRdMatrixf interface is used for faster communication than IRdMatrixfDisp

## Member Function Documentation

HRESULT IRdMatrixf::LoadIdentity | ( | void |  | ) |

Initializes indentity matrix.

HRESULT IRdMatrixf::LockData | ( | [out, retval] RtFloat ** | pMatrix | ) |

Locks matrix and returns access pointer to matrix data.

Returns:
  pMatrix [out,retval] Returned locked matrix.

HRESULT IRdMatrixf::UnlockData | ( | void |  | ) |

Unlocks matrix data.

HRESULT IRdMatrixf::GetAt | ( | [in] RtUlong | i,
|  | [in] RtUlong | j,
|  | [out, retval] RtFloat * | pVal |
| ) |  |  |

Returns the value of one matrix element.

Parameters:

  | i | [in] Row number.
  | j | [in] Column number.

Returns:
  pVal [out, retval] Returned value of matrix element.

HRESULT IRdMatrixf::SetAt | ( | [in] RtUlong | i,
|  | [in] RtUlong | j,
|  | [in] RtFloat | newVal |
| ) |  |  |

Sets the value of one matrix element.

Parameters:

  | i | [in] Row number.
  | j | [in] Column number.
  | newVal | [in] New value to set for matrix element.

HRESULT IRdMatrixf::RotationAxis | ( | [in] RtFloat | x,
|  | [in] RtFloat | y,
|  | [in] RtFloat | z,
|  | [in] RtFloat | angle |
| ) |  |  |

Rotates matrix around arbitrary axis and arbitrary angle.

Parameters:

  | x | [in] X coordinate of rotation axis.
  | y | [in] Y coordinate of rotation axis.
  | z | [in] Z coordinate of rotation axis.
  | angle | [in] Rotation angle in radians.

HRESULT IRdMatrixf::Mult | ( | [in] RtMatrixf * | pM | ) |

Determines the product of given matrix and an arbitrary matrix.

- The result represents the current transformation followed by the transformation given by arbitrary matrix.

Parameters:

  | pM | [in] Matrix to multiply.

HRESULT IRdMatrixf::PreMult | ( | [in] RtMatrixf * | pM | ) |

Determines the product of an arbitrary matrix and given matrix.

Parameters:

  | pM | [in] Matrix to multiply.

HRESULT IRdMatrixf::GetAxisX | ( | [out, retval] IRdVertex ** | ppVect | ) |

Returns the value of x axis for matrix.

Returns:
  ppVect [out, retval] Value of x axis.

HRESULT IRdMatrixf::GetAxisY | ( | [out, retval] IRdVertex ** | ppVect | ) |

Returns the value of y axis for matrix.

Returns:
  ppVect [out, retval] Value of y axis.

HRESULT IRdMatrixf::GetAxisZ | ( | [out, retval] IRdVertex ** | ppVect | ) |

Returns the value of z axis for matrix.

Returns:
  ppVect [out, retval] Value of z axis.

HRESULT IRdMatrixf::GetTransX | ( | [out, retval] RtFloat * | pVal | ) |

Returns the x coordinate of translation.

Returns:
  pVal [out, retval] X coordinate of translation.

HRESULT IRdMatrixf::SetTransX | ( | [in] RtFloat | newVal | ) |

Sets the x coordinate of translation.

Parameters:

  | pVal | [in] X coordinate of translation to set.

HRESULT IRdMatrixf::GetTransY | ( | [out, retval] RtFloat * | pVal | ) |

Returns the y coordinate of translation.

Returns:
  pVal [out, retval] Y coordinate of translation.

HRESULT IRdMatrixf::SetTransY | ( | [in] RtFloat | newVal | ) |

Sets the y coordinate of translation.

Parameters:

  | pVal | [in] Y coordinate of translation to set.

HRESULT IRdMatrixf::GetTransZ | ( | [out, retval] RtFloat * | pVal | ) |

Returns the z coordinate of translation.

Returns:
  pVal [out, retval] Z coordinate of translation.

HRESULT IRdMatrixf::SetTransZ | ( | [in] RtFloat | newVal | ) |

Sets the z coordinate of translation.

Parameters:

  | pVal | [in] Z coordinate of translation to set.

HRESULT IRdMatrixf::GetRoll | ( | [out, retval] RtFloat * | pVal | ) |

Returns the roll value.

Returns:
  pVal [out, retval] Roll value.

HRESULT IRdMatrixf::SetRoll | ( | [in] RtFloat | newVal | ) |

Sets the roll value.

Parameters:

  | pVal | [in] Roll value to set.

HRESULT IRdMatrixf::GetPitch | ( | [out, retval] RtFloat * | pVal | ) |

Returns the pitch value.

Returns:
  pVal [out, retval] Pitch.

HRESULT IRdMatrixf::SetPitch | ( | [in] RtFloat | newVal | ) |

Sets the pitch value.

Parameters:

  | pVal | [in] Pitch value to set.

HRESULT IRdMatrixf::GetYaw | ( | [out, retval] RtFloat * | pVal | ) |

Returns the yaw value.

Returns:
  pVal [out, retval] Yaw.

HRESULT IRdMatrixf::SetYaw | ( | [in] RtFloat | newVal | ) |

Sets the yaw value.

Parameters:

  | pVal | [in] Yaw value to set.

HRESULT IRdMatrixf::GetScaleX | ( | [out, retval] RtFloat * | pVal | ) |

Returns the scale in x axis.

Returns:
  pVal [out, retval] X scale value.

HRESULT IRdMatrixf::SetScaleX | ( | [in] RtFloat | newVal | ) |

Sets the scale in x axis.

Parameters:

  | pVal | [in] X scale value to set.

HRESULT IRdMatrixf::GetScaleY | ( | [out, retval] RtFloat * | pVal | ) |

Returns the scale in y axis.

Returns:
  pVal [out, retval] Y scale value.

HRESULT IRdMatrixf::SetScaleY | ( | [in] RtFloat | newVal | ) |

Sets the scale in y axis.

Parameters:

  | pVal | [in] Y scale value to set.

HRESULT IRdMatrixf::GetScaleZ | ( | [out, retval] RtFloat * | pVal | ) |

Returns the scale in z axis.

Parameters:

  | pVal | [out, retval] Z scale value.

HRESULT IRdMatrixf::SetScaleZ | ( | [in] RtFloat | newVal | ) |

Sets the scale in z axis.

Parameters:

  | pVal | [in] Z scale value to set.

HRESULT IRdMatrixf::GetShearX | ( | [out, retval] RtFloat * | pVal | ) |

Returns the shear in xy.

Returns:
  pVal [out, retval] XY shear value.

HRESULT IRdMatrixf::SetShearX | ( | [in] RtFloat | newVal | ) |

Sets the shear in xy.

Parameters:

  | pVal | [in] XY shear value to set.

HRESULT IRdMatrixf::GetShearY | ( | [out, retval] RtFloat * | pVal | ) |

Returns the shear in xz.

Returns:
  pVal [out, retval] XZ shear value.

HRESULT IRdMatrixf::SetShearY | ( | [in] RtFloat | newVal | ) |

Sets the shear in xz.

Parameters:

  | pVal | [in] XZ shear value to set.

HRESULT IRdMatrixf::GetShearZ | ( | [out, retval] RtFloat * | pVal | ) |

Returns the shear in yz.

Returns:
  pVal [out, retval] YZ shear value.

HRESULT IRdMatrixf::SetShearZ | ( | [in] RtFloat | newVal | ) |

Sets the shear in yz.

Parameters:

  | pVal | [in] YZ shear value to set.

HRESULT IRdMatrixf::AddScaleShear | ( | [in] RtFloat | sx,
|  | [in] RtFloat | sy,
|  | [in] RtFloat | sz,
|  | [in] RtFloat | sxy,
|  | [in] RtFloat | sxz,
|  | [in] RtFloat | syz |
| ) |  |  |

Adds the scale and shear transformation to matrix.

Parameters:

  | sx | [in] Scale in x.
  | sy | [in] Scale in y.
  | sz | [in] Scale in z.
  | sxy | [in] Shear in xy.
  | sxz | [in] Shear in xz.
  | syz | [in] Shear in yz.

HRESULT IRdMatrixf::Rotate | ( | [in] IRdVertex * | center,
|  | [in] IRdVertex * | axes,
|  | [in] RtFloat | angle |
| ) |  |  |

Adds rotation to matrix around arbitrary axis and center.

Parameters:

  | center | [in] Center of rotation.
  | axis | [in] Axis of rotation.
  | angle | [in] Angle of rotation.

See also:
  IRdVertex

HRESULT IRdMatrixf::Decompose | ( | [out] RtMatrixf * | pM,
|  | [out] RtFloat * | ss |
| ) |  |  |

Decomposes transframtion matrix to translation (x,y,z), rotation (roll, pitch, yaw) and scale (sx, sy, sz, sxy, syz, syz).

Returns:
  ppComponents [out, retval] Components of transformation matrix.

See also:
  IRdComponents

HRESULT IRdMatrixf::Shift | ( | [in] IRdVertex * | pShift | ) |

Adds shift to transfomation matrix according to arbitrary vector.

Parameters:

  | pShift | [in] Shift vector to add.

See also:
  IRdVertex

HRESULT IRdMatrixf::LoadMatrix | ( | [in] RtMatrixf * | pM | ) |

LoadMatrix.

Parameters:

  | pM | [in] .

HRESULT IRdMatrixf::Invert | ( | [out] RtMatrixf * | pM | ) |

Invert Matrix.

Parameters:

  | pM | [in] Matrix to invert.

HRESULT IRdMatrixf::Transpose | ( | RtMatrixf * | pM | ) |

Transpose Matrix.

Parameters:

  | pM | [in] Matrix to transpose.

HRESULT IRdMatrixf::ScaleLocal | ( | [in] RtFloat | x,
|  | [in] RtFloat | y,
|  | [in] RtFloat | z |
| ) |  |  |

ScaleLocal.

Parameters:

  | x | [in] Set local scale for x axis.
  | y | [in] Set local scale for y axis.
  | z | [in] Set local scale for z axis.

HRESULT IRdMatrixf::Scale | ( | [in] RtFloat | x,
|  | [in] RtFloat | y,
|  | [in] RtFloat | z |
| ) |  |  |

Scale.

Parameters:

  | x | [in] Set scale for x axis.
  | y | [in] Set scale for y axis.
  | z | [in] Set scale for z axis.

HRESULT IRdMatrixf::Shear | ( | [in] RtFloat | x,
|  | [in] RtFloat | y,
|  | [in] RtFloat | z |
| ) |  |  |

Shear.

Parameters:

  | x | [in] Set shear in x axis.
  | y | [in] Set shear in y axis.
  | z | [in] Set shear in z axis.

HRESULT IRdMatrixf::TranslateLocal | ( | [in] RtFloat | x,
|  | [in] RtFloat | y,
|  | [in] RtFloat | z |
| ) |  |  |

TranslateLocal.

Parameters:

  | x | [in] Set local translation value for x.
  | y | [in] Set local translation value for y.
  | z | [in] Set local translation value for z.

HRESULT IRdMatrixf::Translate | ( | [in] RtFloat | x,
|  | [in] RtFloat | y,
|  | [in] RtFloat | z |
| ) |  |  |

Translate.

Parameters:

  | x | [in] Set translation value for x.
  | y | [in] Set translation value for y.
  | z | [in] Set translation value for z.

HRESULT IRdMatrixf::RotateEuler | ( | [in] RtFloat | x,
|  | [in] RtFloat | y,
|  | [in] RtFloat | z |
| ) |  |  |

RotateEuler.

Parameters:

  | x | [in] Set euler rotation value for x.
  | y | [in] Set euler rotation value for y.
  | z | [in] Set euler rotation value for z.

HRESULT IRdMatrixf::RotateEulerPRY | ( | [in] RtFloat | fPitch,
|  | [in] RtFloat | fRoll,
|  | [in] RtFloat | fYaw |
| ) |  |  |

RotateEulerPRY {pitch/roll/yaw).

Parameters:

  | x | [in] Set eulerPRY rotation value for x.
  | y | [in] Set eulerPRY rotation value for y.
  | z | [in] Set eulerPRY rotation value for z.

HRESULT IRdMatrixf::RotationX | ( | [in] RtFloat | x | ) |

RotationX.

Parameters:

  | x | [in] Set x rotation value.

HRESULT IRdMatrixf::RotationY | ( | [in] RtFloat | y | ) |

RotationY.

Parameters:

  | y | [in] Set y rotation value.

HRESULT IRdMatrixf::RotationZ | ( | [in] RtFloat | z | ) |

RotationZ.

Parameters:

  | z | [in] Set z rotation value.

HRESULT IRdMatrixf::TransformPoint | ( | [in] RtPoint | SourcePoint,
|  | [out] RtPoint * | pDestPoint |
| ) |  |  |

TransformPoint.

Parameters:

  | SourcePoint | [in] Source point.

Returns:
  pDestPoint [out,retval] Returns destination point.

HRESULT IRdMatrixf::TransformVector | ( | [in] RtPoint | SourceVect,
|  | [out] RtPoint * | pDestVect |
| ) |  |  |

TransformVector.

Parameters:

  | SourceVect | [in] Source vector.

Returns:
  pDestVect [out,retval] Destination vector.

HRESULT IRdMatrixf::LookAt | ( | [in] RtVector3f * | pEye,
|  | [in] RtVector3f * | pAt,
|  | [in] RtVector3f * | pUp |
| ) |  |  |

LookAt.

Parameters:

  | pEye | [in] .
  | pAt | [in] .
  | pUp | [in] .

HRESULT IRdMatrixf::MakeRotTrans | ( | [in] RtPoint | center,
|  | [in] RtPoint | axis,
|  | [in] RtFloat | angle |
| ) |  |  |

MakeRotTrans.

Parameters:

  | center | [in] .
  | axis | [in] .
  | angle | [in] .