ではProp3D内部ではどのように計算されいるのか。
Prop3DはMatrixとUserMatrixの二種類の行列と、Position, Orientation, Origin, Scaleといったパラメータをもつ。
vtkProp3D::ComputeMatrix()にこれらのパラメータを使った計算のルーチンがある。
this->GetOrientation();
this->Transform->Push();
this->Transform->Identity();
this->Transform->PostMultiply();
// shift back to actor's origin
this->Transform->Translate(-this->Origin[0], -this->Origin[1], -this->Origin[2]);
// scale
this->Transform->Scale(this->Scale[0], this->Scale[1], this->Scale[2]);
// rotate
this->Transform->RotateY(this->Orientation[1]);
this->Transform->RotateX(this->Orientation[0]);
this->Transform->RotateZ(this->Orientation[2]);
// move back from origin and translate
this->Transform->Translate(this->Origin[0] + this->Position[0], this->Origin[1] + this->Position[1], this->Origin[2] + this->Position[2]);
// apply user defined transform last if there is one
if (this->UserTransform)
{
this->Transform->Concatenate(this->UserTransform->GetMatrix());
}
this->Transform->PreMultiply();
this->Transform->GetMatrix(this->Matrix);
this->MatrixMTime.Modified();
this->Transform->Pop();
よって、
Matrix = UserMatrix Trans(pos) Trans(origin) RotZ RotX RotY Scale Trans(-origin)
という順序で計算している。また、Prop3D::MatrixにはUserMatrixも含まれている。