加载3D对象和纹理以进行OpenGL ES渲染 [英] Loading 3D objects and textures for OpenGL ES rendering

查看:307
本文介绍了加载3D对象和纹理以进行OpenGL ES渲染的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我以3D编辑器应用程序特定的(Blender/Solid/3DS)文件格式存储了一些3D对象,这些文件格式导出到OBJ + MTL文件中,并在PNG/JPG文件中具有可选纹理.

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.

我想将这些对象加载到手机上的OpenGL ES应用程序中(今天用于Android,近期也用于iOS).而且我不想编写自己的OBJ + MTL(或任何其他3D格式)解析器.因此,我想使用一些3D引擎来支持加载3D模型(从OBJ + MTL或从我的3D编辑器中导出到3D引擎特定的头文件/资源​​文件)以实现此目的.

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.

我对Min3D框架有一定的经验,但是在加载文件时有点麻烦(也不会加载材质颜色,仅加载纹理图像),不支持OpenGL ES 2.0,并且显然不能在iOS上运行

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.

我已经看到了流行的用于C头文件的Blender导出脚本(

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).

最近我开始研究Unity 3D,但似乎远远超出了我的需要.我将需要为不使用的功能(动画,游戏特定功能等)付费,并且还需要将其与移动应用程序的其他部分集成.

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.

您会推荐哪种3D引擎/框架?

总结要求:

  • 能够从OBJ + MTL(+ PNG/JPG)加载3D模型和纹理,或者从3D编辑器应用程序导出(使用插件?),并支持没有纹理的彩色材料
  • 支持Android(非常欢迎附加的iOS支持)
  • 支持OpenGL ES 2.0
  • 免费/便宜
  • 易于与本机代码集成(Android首选Java)

推荐答案

OpenSceneGraph支持模型类型的加载.我没有尝试用它来构建任何移动应用程序,但是在论坛和邮件列表上有很多关于iOS和Android的聊天和教程.开源.

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

作为旁注,如果您要做的只是查看模型,并且您不介意将其存储在云中,则可以将其上传到SketchFab:

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

然后使用Firefox移动版查看.只要iOS浏览器支持完整的webGL,iOS就会支持.

And view with Firefox mobile. iOS support would come whenever iOS browsers support full webGL.

他们在后台使用osg读取模型,我认为OSGjs用于前端.

They're using osg behind the scenes to read models, and I think OSGjs for front-end.

这篇关于加载3D对象和纹理以进行OpenGL ES渲染的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆