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

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

问题描述

我有一些 3D 对象存储在 3D 编辑器应用程序特定(Blender/Solid/3DS)文件格式中,导出到 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 导出脚本 (http://iphonedevelopment.blogspot.com/2009/06/using-3d-models-from-blender-in-opengl.html) 但我相信它不支持材质颜色导出(不使用纹理图像时).

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.

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

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