问题
I have some 3D objects stored in 3D editor application specific (Blender/Solid/3DS) file format exported to OBJ+MTL files with optional textures in PNG/JPG files.
I would like to load these objects in OpenGL ES application on mobile phone (today for Android and in the near future for iOS too). And I don't want to write my own OBJ+MTL (or any other 3D format) parser. So I would like to use some 3D engine with support for loading 3D models (from OBJ+MTL or exported to 3D engine specific header/resource files from within my 3D editor) to achieve this.
I have some experience with Min3D framework, but it's a bit buggy at loading the files (also won't load material colors, only texture images), doesn't support OpenGL ES 2.0, and Obviously doesn't run on iOS.
I've seen the popular blender export script for C header files (http://iphonedevelopment.blogspot.com/2009/06/using-3d-models-from-blender-in-opengl.html) but I believe it doesn't support material color export (when texture image is not used).
Lately I've started to look at Unity 3D, but it seems to be a lot more than I need. I would need to pay for the features I won't be using (animation, game specific features, etc.) and also I'll need to integrate it with other parts of my mobile application.
What 3D engine/framework would you recommend ?
To summarize the requirements:
- Ability to load 3D models + textures from OBJ+MTL(+PNG/JPG) or exported from 3D editor application (using plugin ?), with support for colored materials without textures
- Supports Android (additional iOS support is very welcome)
- Supports OpenGL ES 2.0
- Free / Cheap
- Easy integration with native code (Java is preferred for Android)
回答1:
OpenSceneGraph supports loads of model types. I haven't tried to build any mobile apps with it, but there's a lot of chatter and some tutorials on the forums/mailing list about doing it, for both iOS and Android. Open Source.
http://www.openscenegraph.com
http://forum.openscenegraph.org/viewtopic.php?t=10076
EDIT: as a side note, if all you want to do is view your models, and you don't mind storing them in the cloud, you can just upload them to SketchFab:
http://sketchfab.com/faq
And view with Firefox mobile. iOS support would come whenever iOS browsers support full webGL.
They're using osg behind the scenes to read models, and I think OSGjs for front-end.
来源:https://stackoverflow.com/questions/12172201/loading-3d-objects-and-textures-for-opengl-es-rendering