Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk® FBX® / FBX SDK / OpenGL viewer for FBX files
  RSS 2.0 ATOM  
9 pages: 6.7.8.9 first last

OpenGL viewer for FBX files
Rate this thread
 
25385
 
Permlink of this thread  
avatar
  • adario
  • Posted: 12 October 2010 03:05 AM

Well, TNG 3D is importing the four bottles—but their transforms seem to be all the identity, and the file scale looks way off…

I’m attaching a screenshot from the TNG 3D layout application (not freely available, sorry).

HTH,
Dario



Attachment Attachment
Replies: 0
avatar

The vertex positions seem to be scaled way up.

GetControlPointAt for the first vert is:

59999998658.895493
0.00000000000000000
42500000447.034836



Replies: 0
avatar

Yes its the individual transform setting that eludes me.

I can set the nodes transform and thus its position location but this does not
necessarily get read properly when it gets reloaded.

FBX has deprecated some functions related to the transforms but even
using the new code its only the KFBXNODE transform that will
keep the data for the node, and it is this data I THINK that must be used
to view its transform, not the transform of the instanced mesh.

Thus your display could be right or wrong depending upon whose transform you use when
you load the file.  Do you load the node’s transform for the mesh or the mesh’s transform for
the nodes????

Dunno however if this is correct as it is and I have to interpret this
transform or if there is yet another one.

vs



Replies: 1
/userdata/avatar/3yvwf23us_doug100x100.png

It may be the geometry matrix you are after.  This is applied per node in addition to all the other scaling.

lT pNode->GetGeometricTranslation(KFbxNode::eSOURCE_SET);
  
lR pNode->GetGeometricRotation(KFbxNode::eSOURCE_SET);
  
lS pNode->GetGeometricScaling(KFbxNode::eSOURCE_SET);
Author: Doug Rogers

Replied: 12 October 2010 03:57 AM  
avatar

Yes I use those functions.  The offset data per node is there, but perhaps as I dont set the scale it scales all of my geometry up by some default level.  Thus it appears as there is only 1 bottle.  I will adjust the scale and retest.  Thanks.



Replies: 1
/img/forum/dark/default_avatar.png

There is only one mesh object in your file, and its geometric transformation is the identity.
The cloned node objects, on the other hand, contain different translations, all located on the XZ plane.  However, the values for these translations are way less than 1, so if your vertices represent really large numbers, the bottles will all look like they’re at the same positions…

HTH,
Dario

Author: adario

Replied: 13 October 2010 02:19 AM  
avatar

I think I have sorted my scale.  My model loads correctly in deepview, and I will now start writing my own reader to process instancing.  However your viewer didnt seem to load the instances.  Here is a new instanced fbx file - this time with four cans.  Its in ascii mode.



Replies: 0
avatar

And here it is again zipped ....



Attachment Attachment
Replies: 0
avatar
  • adario
  • Posted: 17 October 2010 11:53 PM

TNG 3D is loading the can instances—see attachment.
This time the scale is really, really small… so are the transforms.



Attachment Attachment
Replies: 0
avatar

My version of your software is a few weeks old.  I will download a newer one and try. Thanks.



Replies: 1
/img/forum/dark/default_avatar.png

You should certainly get the latest TNGViewer version; however, the screenshot I posted is from the editor application, which is unfortunately not available to the public.

Since the transforms are all imported equal (the identity), I suspect there is a problem in accessing transformation information in cloned objects—TNGViewer will give you the impression of only one can being visibile, whereas all four are displayed at (roughly) the same position…

Author: adario

Replied: 18 October 2010 12:22 AM  
avatar

ok.  In doesnt matter now I have worked out why it was not right.  I will move onto writing the instance importer. Thanks for the data validation.



Replies: 1
/img/forum/dark/default_avatar.png

Here is another for you though.  I cant seem to work out why two different ZUP max created FBX models display incorrectly for me.  No matter how I use convertscene and get the transform and rotation data, one axis is always lost, so either model A or model B appears rotated while the othere is correct.  This is using FBX 2009.3.  Was there a problem with this in 2009.3??  The two different models contain submeshes and have bits that have LCLrotations and lcltranslations.

Author: normalblock8byteslong

Replied: 10 November 2010 09:29 PM  
avatar

I corrected the cubecreator sample produced by the fbx team so it supports instancing, and can display the results in DeepView but it still wont display in Tngviewer.  Have you tried displaying a model with instances in your tngviewer??  Not the other app you show.

Here is he corrected code:

KFbxNode * gFirstNode = NULL;
// create a new cube
void CreateCubeDetailed( char* pCubeName,
double pX,
double pY,
double pZ,
int pRotateAxe,
bool pWithMaterial,
bool pWithTexture,
bool pAnimate
)
{
KFbxNode* lCube = NULL;

if( gCubeNumber < 2 )
{
lCube = CreateCubeMesh(gScene, pCubeName);
gFirstNode = lCube;
}
else if( NULL != gFirstNode )
{
// create a KFbxNode
lCube = KFbxNode::Create(gScene,pCubeName);

// set the node attribute
lCube->SetNodeAttribute(gFirstNode->GetMesh());

// set the shading mode to view texture
lCube->SetShadingMode(KFbxNode::eTEXTURE_SHADING);

// rescale the cube
lCube->LclScaling.Set(KFbxVector4(0.3, 0.3, 0.3));
}

.....



Replies: 1
/img/forum/dark/default_avatar.png

Can you provide the modified file with instances?

Author: adario

Replied: 10 December 2010 12:54 AM  
9 pages: 6.7.8.9 first last