- Code: Select all
void ExportCamera(std::ostream &outputstream, HCamera *camera) {
Matrix34 m = camera->GetGlobalMatrix();
outputstream << "Translate [" <<
m[0][0] << " " << m[1][0] << " " << m[2][0] << " 0.0 " <<
m[0][1] << " " << m[1][1] << " " << m[2][1] << " 0.0 " <<
m[0][2] << " " << m[1][2] << " " << m[2][2] << " 0.0 " <<
m[0][3] << " " << m[1][3] << " " << m[2][3] << " 1.0]" << std::endl;
outputstream << "Camera \"perspective\"" << std::endl;
outputstream << "\t" << "\"float fov\ [" << 90.0 << "]" << std::endl; // here you'd use camera->GetFocalLength() to compute true FOV value
}
At least that's the general idea. Thus you don't have to use LookAt or any of the others at all, just export the global transformation as-is.
