Import FBX to ARToolKit

老子叫甜甜 提交于 2019-12-11 14:32:20

问题


I have problem about importing the FBX model. I have done it with Unity so I know the model exported well but I should do with the native code as well. I am getting error:

2015-06-02 15:20:21.721 ARAppNFTOSG[746:481003] Error: unsupported model file
type (fbx). Ignoring.

I am trying it on the AR example named ARAppNFTOSG. I changed the model.dat as:

1

OSG/Geralt/watcher.FBX
0.0 0.0 0.0
0.0 1.0 0.0 0.0
10.0 10.0 10.0
MARKER 1

I looked at the OSG forums and found that I should install FBX SDK which I installed the 2013.3 and 2014.1. Also add the line:

 USE_OSGPLUGIN(fbx)

to the osgplugins.h I am not sure FBX SDK that I installed linked somehow because I didn't do manual linking. What should I do? I am using mac by the way.


回答1:


The FBX plugin for OSG is not supplied with ARToolKit for iOS, and I'm not sure it can even be built for iOS.

The best option is to use the osgconv command-line tool from an installation of OSG on OS X or Windows (e.g. http://www.artoolkit.org/dist/3rdparty/openscenegraph/3.2.x/OpenSceneGraph-3.2.2%20OS%20X%2010.7%2B%20Installer.zip includes FBX plugin and supplies osgconv at path /Applications/OpenSceneGraph/Applications/osgconv) to convert from FBX to a supported OSG format, e.g. .osgb and load that at runtime.




回答2:


Is this a one-time import, or will you be using a lot of FBX models?

If it's a one-time thing, you can use the trial of Sketchup Pro with the trial FBX importer plugin: http://www.simlab-soft.com/3d-plugins/FBX_Importer_For_Sketchup-main.aspx

And export it to something that your downloaded ARToolkit understands. (probably COLLADA .dae files or 3DS files - see what osgdb plugins it has, they should be named something like osgdb_dae.so for example).

If it'll be a long-term issue, then you will have to build Open Scene Graph core classes and the FBX plugin from source. If you tried this before you grabbed the FBX SDK, delete your cmake cache files and start over with the FBX flag turned on.

If you think you built it correctly, you might also have to build the "install" target to get the plugins registered with your system.




回答3:


USE_OSGPLUGIN(fbx)

is only necessary if you are statically linking. Are you statically linking OSG and its plugins? one normally does not do that.

You might try setting the OSG_NOTIFY environment variable up a lot and looking at the output. It might tell you why it's failing to load the FBX file.



来源:https://stackoverflow.com/questions/30598005/import-fbx-to-artoolkit

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!