|
|
|
Tell us what you think of the site.
|
Autodesk Media & Entertainment User Community
|
Autodesk® 3ds Max®
|
|
Autodesk® Maya®
|
|
Autodesk® Softimage®
|
|
Autodesk® MotionBuilder®
|
|
Autodesk® Mudbox™
|
|
Autodesk® ImageModeler™
|
|
Autodesk® Sketchbook® Pro
|
|
Autodesk® Smoke on Mac®
|
| OpenGL viewer for FBX files
|
|
|
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
|
|
|
|
|
|
The vertex positions seem to be scaled way up.
GetControlPointAt for the first vert is:
59999998658.895493
0.00000000000000000
42500000447.034836
|
|
|
|
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
|
|
|
|
|
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
|
|
|
|
|
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.
|
|
|
|
|
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
|
|
|
|
|
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.
|
|
|
|
And here it is again zipped ....
|
|
|
|
TNG 3D is loading the can instances—see attachment.
This time the scale is really, really small… so are the transforms.
| Attachment
|
|
|
|
|
|
My version of your software is a few weeks old. I will download a newer one and try. Thanks.
|
|
|
|
|
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
|
|
|
|
|
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.
|
|
|
|
|
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
|
|
|
|
|
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));
}
.....
|
|
|
|
|
Can you provide the modified file with instances?
Author: adario
|
| Replied: 10 December 2010 12:54 AM
|
|
|
|
|
|
|