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 / [Resolved] Strange bug while importing one file (was not a bug)
  RSS 2.0 ATOM  

[Resolved] Strange bug while importing one file (was not a bug)
Rate this thread
 
43651
 
Permlink of this thread  
avatar
  • luinil
  • Posted: 26 May 2010 09:36 PM
  • Location: Tokyo
  • Total Posts: 23
  • Joined: 21 April 2010 01:09 AM

Hello,

I’m writing an importer for FBX files using the FBX SDK, but I have a problem while importing one file.

Almost all is perfectly imported and displayed : I get the right shapes at the right positions, using the good materials. The only problem is with 2 of the objects : the nurb object and the triangulated nurb object (green spheres). All other objects are correctly imported and displayed.

My problem is that both “nurbs” are “inside-out” : The material is displayed in the internal face and not on the external one as for the other objects. I think that the problem would be that the normals had been inverted somewhere in the importation process, but I don’t see why only those two models would have the normals inverted ?
As the triangulated Nurb is a Mesh in the FBX file, it is imported exactly as all the other meshes in this file (the mesh object, the triangulated nurb surface, the triangulated patch...) which are correctly imported and displayed, so again I wonder why my importation algorithm would invert the diagonals only for one of the meshes?

So I was wondering if the error was from my importation program, and in that case if you would have an idea about where I could be wrong, or if those two objects are actually “inside-out” in the FBX file and then why the quick-time plugin doesn’t display them inside out?

Thanks for you help !

{on the picture, at the left the inside-out “triangulated nurb” object and on the right the correctly displayed “triangulated nurb surface” object}.

edit : I was thinking that the file was an example file from the sdk, but actually it is a file created by a coworker, so I add it to the thread.



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

You could triangulate the KFbxGeometry attributes of the problematic objects, in order to obtain KFbxMesh objects; then, you could try to call the CheckIfVertexNormalsCCW API to see whether the objects are considered CCW or not.

HTH,
Dario

Author: adario

Replied: 27 May 2010 03:52 AM  
avatar
  • luinil
  • Posted: 27 May 2010 01:48 PM

thanks for your answer.

I tried to apply CheckIfVertexNormalsCCW on my objects (as I already convert them all to meshes while importing). The results are not very helpful :

the two objects having problems don’t gave me the same value (true for the nurb and false for the triangulated nurb).

Then applying ComputeVertexNormals on the object doesn’t correct the normals.



Replies: 0
avatar

>>The only problem is with 2 of the objects : the nurb object and the triangulated nurb object (green spheres).

Hi luinil,
As imported your file to Maya, I found that the mesh normals are pointed to inside. Obviously, the normals should point to outside.You may inverse these normals and test the result.

Also for the nurbs, the normal is also inverse. Please reverse your NURBS direction.



Zhihao, Data Platform - Autodesk

Attachment Attachment
Replies: 0
avatar
  • luinil
  • Posted: 02 June 2010 12:57 PM

So by displaying the inside face of the sphere, I was actually “right”.

As the quicktime pluging is displaying a normal sphere, I was thinking that I was wrong in my import.

Thanks for your help.



Replies: 0