Community
FBX Forum
Welcome to Autodesk’s FBX Forums. Share your knowledge, ask questions, and explore popular FBX topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

DirectX Viewer for FBX files (v 3.x). [Source Code Posted] UPDATED to FBX SDK 2014.0 DirectX June 2011 SDK. Visual Studio 2010/2012

85 REPLIES 85
Reply
Message 1 of 86
Anonymous
8881 Views, 85 Replies

DirectX Viewer for FBX files (v 3.x). [Source Code Posted] UPDATED to FBX SDK 2014.0 DirectX June 2011 SDK. Visual Studio 2010/2012

Uses the FBX SDK 2014 beta 2.

Visual Studio 2010 and 2012. 64 and 32 bit builds.

Viewer imports FBX models and displays them without using the FBX SDK library.

Source code posted here: http://code.google.com/p/fbxviewer/


Post about it here:
http://dougrogers.blogspot.com/2012/10/fbx-viewer-3.html
85 REPLIES 85
Message 21 of 86
Anonymous
in reply to: Anonymous

Yes, Scene4 in incorrect position. How do you get correctly UV coords?


This looks like a bug in ResetPivotSetAndConvertAnimation . There is a pre animation of -90 in X, and a rotation of 90 in the animation, but ResetPivotSetAndConvertAnimation does not remove the 90 X rotation in the animation, just in the pre rotation.
Message 22 of 86
Anonymous
in reply to: Anonymous

Updated to 0.5, see original post.
Message 23 of 86
Anonymous
in reply to: Anonymous

Cool! Normals is good! I will research.
I calculation cross product for vertices of triangles, but sometimes i have inverted normals.
Message 24 of 86
Anonymous
in reply to: Anonymous

Ohhhh man,

Thats what i'm looking for since long time, can you give to source code here or pm it to me ? I really need it :S

Thanks also for the great work 😄

Peace
Message 25 of 86
Anonymous
in reply to: Anonymous

I have found in what was my problem with normals. It`s not normals. It is - "GetPolygonSize" 🙂

16709_MLITgU2y1i0x3qt0TvsD.zip

Message 26 of 86
Anonymous
in reply to: Anonymous

Doug, how do you get texcoods? I really don`t understand this.
Message 27 of 86
Anonymous
in reply to: Anonymous

Doug, how do you get texcoods? I really don`t understand this.


I'm still working on it too. Most of what I have is gotten from ViewScene and ImportScene.
See this thread: area.autodesk.com/forum/Autodesk-FBX/fbx-sdk/getuv-and-getlayerelementoftype-mismatch/

There is only one texture coordinate set per layer. Each texture element that uses that coordinate set is in that layer.


for (int i = 0; i < pMesh->GetLayerCount(); i++)
{

KFbxLayer * pLayer = pMesh->GetLayer(i);
if (pLayer == NULL)
continue;

for each element type you support (ELayerElementType pTypeIdentifier)
{
KFbxLayerElementTexture * pTextureElement = (KFbxLayerElementTexture *)pLayer->GetLayerElementOfType(pTypeIdentifier);

if (pTextureElement == NULL)
continue; // no element of that type

KFbxLayerElementUV* pLayerUV = pLayer->GetUVs();
if (pLayerUV == 0)
continue; // no texture coordinates

KFbxLayerElement::EMappingMode mappingMode = pTextureElement->GetMappingMode();
KFbxLayerElement::EReferenceMode referenceMode = pTextureElement->GetReferenceMode();


// get coordinates
KFbxLayerElementArrayTemplate<KFbxVector2> &lUVArray = pLayerUV->GetDirectArray();

// now get the coordinates depending on reference mode and mapping mode
}
}
Message 28 of 86
Anonymous
in reply to: Anonymous

Doug, do you use TriangulateInPlace? Scene5 have strange problem, probably with z-buffer.
Message 29 of 86
Anonymous
in reply to: Anonymous

Yes, I do. Where is Scene5?
Message 30 of 86
Anonymous
in reply to: Anonymous

Where is Scene5?

Post #24
Message 31 of 86
Anonymous
in reply to: Anonymous

The problem is in the scene. Scene5 has lamina faces (or very nearly so) in original mesh which causes the z fighting. You need to remove them from the original.
Message 32 of 86
Anonymous
in reply to: Anonymous

Updated to 0.6, see original post.
Message 33 of 86
Anonymous
in reply to: Anonymous

Updated to 0.8, see original post.
Message 34 of 86
Anonymous
in reply to: Anonymous

Updated to 0.9, see original post.
Message 35 of 86
Anonymous
in reply to: Anonymous

v 0.95 update posted.
See original post
Message 36 of 86
Anonymous
in reply to: Anonymous

Final post of the viewer. See original post.
Message 37 of 86
Anonymous
in reply to: Anonymous

Hi,

Is there any readme or how to?
I am unable to launch the app, I've got two error messages:
-The Direct3D device has non-zero refernce count, meaning some objects were not released
then
-Could not find required media
then the app closes.

I've also tried to launch it in a command line, with the path of a fbx file in parameter, with no success.

DirectX_90.c_Nov2008_redist is installed on my computer (WinXP pro 32b)

Thanks a lot!

PS: no release of the source code? 🙂
Message 38 of 86
Anonymous
in reply to: Anonymous

Hi,

Is there any readme or how to?
I am unable to launch the app, I've got two error messages:
-The Direct3D device has non-zero refernce count, meaning some objects were not released
then
-Could not find required media
then the app closes.

I've also tried to launch it in a command line, with the path of a fbx file in parameter, with no success.

DirectX_90.c_Nov2008_redist is installed on my computer (WinXP pro 32b)

Thanks a lot!

PS: no release of the source code? 🙂


I fixed the startup issue. That is the problem with testing on your own system 😉

Good idea about the readme file,I added it to the original post.

As for releasing, I have been sent only two examples for testing, so I'm not confident in the loading yet.
Message 39 of 86
Anonymous
in reply to: Anonymous

Thanks a lot Doug!

Some comments:
-Reset Time Button always crashes the application
-I can not load plasticman.fbx ( C:\Program Files\Autodesk\MotionBuilder 2009 Trial\OpenRealitySDK\Scenes\PlasticMan.fbx )
-Crash sometimes when closing the application
-Crash sometimes when going full screen
-Fbx takes have a start frame that is often different from 0. I think the SampleViewer provided with the FBX SDK uses the take start frame to read animation. This would be very useful as we don't have any timeline in your app.

( Another little note: Orbital cameras are commonly used in 3D apps )

Cheers !
Message 40 of 86
Anonymous
in reply to: Anonymous

Thanks a lot Doug!

Some comments:
-Reset Time Button always crashes the application
-I can not load plasticman.fbx ( C:\Program Files\Autodesk\MotionBuilder 2009 Trial\OpenRealitySDK\Scenes\PlasticMan.fbx )
-Crash sometimes when closing the application
-Crash sometimes when going full screen
-Fbx takes have a start frame that is often different from 0. I think the SampleViewer provided with the FBX SDK uses the take start frame to read animation. This would be very useful as we don't have any timeline in your app.

( Another little note: Orbital cameras are commonly used in 3D apps )

Cheers !

Thanks for the comments.

>Reset Time Button always crashes the application
I'll fix that. It crashes when there is not animation.

>-I can not load plasticman.fbx
Can you send me the .fbx file that crashes the viewer? I'm sure there are cases that I'm not handling.

I have seen the crash when closing. I't somewhere in Direct3D DXSAS, so I'm still tracking that down.
As for the the full screen, its the same as the crash on exit issue. DXSAS is trying to free its resources, but faults.

The timeline should be displayed in the upper left hand corner.

>-Fbx takes have a start frame that is often different from 0. I think the SampleViewer provided with the FBX SDK uses the take start frame to >read animation. This would be very useful as we don't have any timeline in your app.
I'm not sure what you are asking for here.

>( Another little note: Orbital cameras are commonly used in 3D apps )
I'm just using Direct3D's first person camera. I wanted to be able to move around the scene easily.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report