Jump to content
  • Advertisement
Sign in to follow this  
osiris_dev

FBX Transformation problem

This topic is 922 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello,

 

I am trying to import data from fbx mesh file. I stacked with transformations. There are 2 levels of transformations for geometry in FXB, node and geometry, usually it is only first one, second transform applies on export for positions normal and other 3D data. I have two tested models without skinning. In first one geometry transform is identity, second one has both transforms.

 

The second case is most common in 3DS Max, but I getting correct look for second model if I don't use node transform at all when the first one needs it!!! And it is in one mesh format and I can't understand why.

 

[attachment=32086:ship1.jpg]

This is look when I doing geometry transform only

 

 

 

FbxAMatrix 
mGeometryTransform = GetGeometry(pFBXNode);


// transform it to LH if 
needed
if 
(m_bOptionConvertToLH)
{
FbxVector4 
Translation = mGeometryTransform.GetT();
FbxVector4 
Rotation = mGeometryTransform.GetR();

Translation.Set(Translation.mData[0], 
Translation.mData[2], Translation.mData[1]);

mGeometryTransform.SetT(Translation);
}

m_mTransformGeometry = 
GetAFMatrixFromFBX(mGeometryTransform);
 
In vertex 
buffer:
 
iControlPoint = 


pFBXMesh->GetPolygonVertex(i, 
0);
Point = 


pFBXMesh->GetControlPointAt(iControlPoint);
pVertexes->x = 


static_cast<float>(Point.mData[0]);
pVertexes->y = 


static_cast<float>(Point.mData[1]);
pVertexes->z = 


static_cast<float>(Point.mData[2]);
 
// 
node geometry 
transform
AFVector3TransformCoords(pVertexes, pVertexes, 
&m_mTransformGeometry);

 

 

 

 

 

 

 

 

And this when I add Node Transform

[attachment=32087:ship2.jpg]

FbxVector4 Translation = 
pFBXNode->LclTranslation;
FbxVector4 Rotation = 
pFBXNode->LclRotation;
FbxVector4 Scaling = 
pFBXNode->LclScaling;

FbxAMatrix 
Transform;
Transform.SetTRS(Translation, Rotation, 
Scaling);
 
pMeshFrame->m_m4x4Transform = 
GetAFMatrixFromFBX(Transform);

 

To get World Transform I making multiplication for hierarchy:

 

 

 

AFMatrixMultiply(&spSceneObject->m_mWorld, 
&spSceneObject->m_mLocal, 
spSceneObject->GetParent()->GetMatrixWorld());

 

 

 

m_mLocal is a m_m4x4Transform transform. I can't use only Geometry Transform or all cases. Any ideas what is wrong here?

 

P.S. Sorry for alignment, can't make it good)

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!