CameraObject *cam = (CameraObject*) node->EvalWorldState(ip->GetTime()).obj;
Matrix3 atm = node->GetObjectTM(ip->GetTime(), 0);// 4x3 matrix
Matrix3 targetTM;
node->GetTargetTM(ip->GetTime(), targetTM);
Matrix3 matD3D;
Point3 p1 (1.0f, 0.0f, 0.0f);
Point3 p2 (0.0f, 0.0f, 1.0f);
Point3 p3 (0.0f, 1.0f, 0.0f);
Point3 p4 (0.0f, 0.0f, 0.0f);
matD3D.SetRow(0, p1);
matD3D.SetRow(1, p2);
matD3D.SetRow(2, p3);
matD3D.SetRow(3, p4);
atm = atm * matD3D;
targetTM = targetTM * matD3D;
int ki, kj;
MRow *pcvm = atm.GetAddr();
for (ki = 0; ki < 4; ki++) {
for (kj = 0; kj < 3; kj++) {
d3dViewXform.m[ki][kj] = pcvm[ki][kj];
}
}
// Assign the fourth column (perspective terms)
d3dViewXform.m[0][3] = d3dViewXform.m[1][3] = d3dViewXform.m[2][3] = 0.0f;
d3dViewXform.m[3][3] = 1.0f;
for (ki = 0; ki < 4; ki++) {
d3dViewXform.m[ki][2] *= -1.0f;
}
There must be something wrong that I can't tell.
Maybe orthogonal and perspective problem.. Any ideas?
Thanks
Jack