|
Hi,
Here is a new issue with the camera postion.
I rendered the following elements in the scene:
- 1 camera (position 1, 2, 3)
- 1 light (position 1, 2, 3)
- 1 cube (position 1, 2, 3)
The three elements have the same location, no scaling and no rotation.
When loading the local matrices I get the same one for the light and the cube but the one for the camera is different !
Same result if I change the Axis System from the default to OpenGL.
Here is the code used to dump the informations:
/*-------------------------------------------------------------------------*/
bool __fbxParseNode(KFbxNode *);
/*-------------------------------------------------------------------------*/
bool fbxParseScene(KFbxScene *fbxScene) {
if(fbxScene == NULL)
{
return false;
}
/**/
KFbxAxisSystem::OpenGL.ConvertScene(fbxScene);
/**/
__fbxParseNode(fbxScene->GetRootNode());
return true; }
/*-------------------------------------------------------------------------*/
bool __fbxParseNode(KFbxNode *fbxNode) {
if(fbxNode == NULL)
{
return false;
}
/**/
KFbxVector4 vector;
printf(" Geometric Transformations: %s\n", fbxNode->GetName());
vector = fbxNode->EvaluateLocalTranslation();
printf(" Translation: %f %f %f\n\n", vector[0], vector[1], vector[2]);
vector = fbxNode->EvaluateLocalRotation();
printf(" Rotation: %f %f %f\n\n", vector[0], vector[1], vector[2]);
vector = fbxNode->EvaluateLocalScaling();
printf(" Scaling: %f %f %f\n\n", vector[0], vector[1], vector[2]);
KFbxXMatrix matrix;
matrix = fbxNode->EvaluateLocalTransform();
printf(" LocalMatrix: %f %f %f %f\n"
" %f %f %f %f\n"
" %f %f %f %f\n"
" %f %f %f %f\n\n",
matrix[0][0], matrix[0][1], matrix[0][2], matrix[0][3],
matrix[1][0], matrix[1][1], matrix[1][2], matrix[1][3],
matrix[2][0], matrix[2][1], matrix[2][2], matrix[2][3],
matrix[3][0], matrix[3][1], matrix[3][2], matrix[3][3]
);
/**/
for(int i = 0; i < fbxNode->GetChildCount(); i++)
{
__fbxParseNode(fbxNode->GetChild(i));
}
return true; }
/*-------------------------------------------------------------------------*/
Here id the result for the default:
Geometric Transformations: RootNode
Translation: 0.000000 0.000000 0.000000
Rotation: 0.000000 0.000000 0.000000
Scaling: 1.000000 1.000000 1.000000
LocalMatrix: 1.000000 0.000000 0.000000 0.000000
0.000000 1.000000 0.000000 0.000000
0.000000 0.000000 1.000000 0.000000
0.000000 0.000000 0.000000 1.000000
Geometric Transformations: camera3
Translation: 1.000000 -3.000000 2.000000
Rotation: 0.000000 0.000000 0.000000
Scaling: 1.000000 1.000000 1.000000
LocalMatrix: 0.000000 1.000000 -0.000000 0.000000
0.000000 0.000000 1.000000 0.000000
1.000000 -0.000000 0.000000 0.000000
1.000000 -3.000000 2.000000 1.000000
Geometric Transformations: pCube1
Translation: 1.000000 -3.000000 2.000000
Rotation: 0.000000 0.000000 0.000000
Scaling: 1.000000 1.000000 1.000000
LocalMatrix: 1.000000 0.000000 0.000000 0.000000
0.000000 0.000000 1.000000 0.000000
0.000000 -1.000000 0.000000 0.000000
1.000000 -3.000000 2.000000 1.000000
Geometric Transformations: pointLight1
Translation: 1.000000 -3.000000 2.000000
Rotation: 0.000000 0.000000 0.000000
Scaling: 1.000000 1.000000 1.000000
LocalMatrix: 1.000000 0.000000 0.000000 0.000000
0.000000 0.000000 1.000000 0.000000
0.000000 -1.000000 0.000000 0.000000
1.000000 -3.000000 2.000000 1.000000
Here is the result for the OpenGL one:
Geometric Transformations: RootNode
Translation: 0.000000 0.000000 0.000000
Rotation: 0.000000 0.000000 0.000000
Scaling: 1.000000 1.000000 1.000000
LocalMatrix: 1.000000 0.000000 0.000000 0.000000
0.000000 1.000000 0.000000 0.000000
0.000000 0.000000 1.000000 0.000000
0.000000 0.000000 0.000000 1.000000
Geometric Transformations: camera3
Translation: 1.000000 2.000000 3.000000
Rotation: 0.000000 0.000000 0.000000
Scaling: 1.000000 1.000000 1.000000
LocalMatrix: 0.000000 -0.000000 -1.000000 0.000000
0.000000 1.000000 -0.000000 0.000000
1.000000 0.000000 0.000000 0.000000
1.000000 2.000000 3.000000 1.000000
Geometric Transformations: pCube1
Translation: 1.000000 2.000000 3.000000
Rotation: 0.000000 0.000000 0.000000
Scaling: 1.000000 1.000000 1.000000
LocalMatrix: 1.000000 0.000000 0.000000 0.000000
0.000000 1.000000 -0.000000 0.000000
0.000000 0.000000 1.000000 0.000000
1.000000 2.000000 3.000000 1.000000
Geometric Transformations: pointLight1
Translation: 1.000000 2.000000 3.000000
Rotation: 0.000000 0.000000 0.000000
Scaling: 1.000000 1.000000 1.000000
LocalMatrix: 1.000000 0.000000 0.000000 0.000000
0.000000 1.000000 -0.000000 0.000000
0.000000 0.000000 1.000000 0.000000
1.000000 2.000000 3.000000 1.000000
We can see that the camera has not the same position as the to other objects.
Is there an issue about the camera position?
Have I done something wrong to get the local matrices?
Cheers,
Chris
|