|
Hello,
I’m using the ComputePerspective() function of KFbxCamera to try and generate a projection matrix for my camera. I’m using the 2011 SDK. Here’s the code:
KFbxMatrix m1 = mCamera->ComputePerspective(mCamera->GetApertureWidth()*mCamera->GetSqueezeRatio()*1e6, mCamera->GetApertureHeight()*1e6, false);
and here is the resulting matrix:
(gdb) p m1 $1 = {
<fbxsdk_2011_3_1::fbxVectorTemplate4<fbxsdk_2011_3_1::fbxVectorTemplate4<double> >> = {
mData = {{
mData = {1.5500031000062002, 0, 0, 0}
}, {
mData = {0, 2.7559055118110241, 0, 0}
}, {
mData = {0, 0, -1.0000200002000021, -1}
}, {
mData = {0, 0, -0.20000200002000021, 1}
}}
}, <No data fields>} (gdb)
Note the last entry is “1”. As far as I know, a proper perspective projection matrix has 0 in that spot. When I use the matrix as-is, it does not produce a correct image (my image does not match the image I render from Maya). When I manually set that entry to “0”, I *do* get the correct image (that perfectly matches the rendering from Maya). This leads me to believe there is a bug in the implementation of ComputePerspective().
Cheers,
Russ MacKenzie
|