问题
I have a requirement to display an interactive 3D model (the client supplies few FBX files) in one of the screens in a native Objective-C/Swift app.
I know that there's a possibility to work with Unity/Cocos3D but then the entire app will have to be Unity/Cocos3D based. In my case the app has to be native and only one screen (one of the tabs in the tab bar controller) should integrate the 3D model that the user can move/rotate etc.
Thanks.
回答1:
The FBX SDK is available on iOS and I wrote a little tutorial to demo how to use it here. However, the FBX SDK does contain a viewport/canvas for displaying FBX file on any OS. For displaying FBX you would need to create your own view. There is couple of solutions you can use here:
- without programming, you can use the 'FBX Review'. This tools is free and designed to display FBX, DAE, OBJ, ... files
- you can implement your own viewport/view such as an obj view like I did here, but it would probably need to be rewritten. I wrote it overnight for a hack, so it needs to be optimized.
- you use the iOS SceneKit library which would be a better approach than implementing your own view.
回答2:
If you go with option 3 above, you can use Unity to export a Collada (.dae) file for importing into SceneKit thru the collada exporter. You can buy the exporter on the Unity Asset Store directly; there's one for Unity 5.x and one for Unity 2017.
来源:https://stackoverflow.com/questions/37641973/use-fbx-file-with-3d-model-in-ios-native-app