Android OpenGL .OBJ 文件加载器 [英] Android OpenGL .OBJ file loader

查看:34
本文介绍了Android OpenGL .OBJ 文件加载器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

似乎有相当多的 OBJ 网格文件加载器是人们开发用于 Android 平台的.我想知道是否有人对这些有任何经验,并且可以就哪种似乎最适合他们提出建议.

There seem to be quite a number of OBJ mesh file loaders out there that people have developed for use on the Android platform. I'm wondering if anyone has any experience with these and can offer a recommendation on which one seems to work best for them.

这是我的标准:

  • 轻量级(小文件),
  • 针对速度进行了优化,
  • 易于实施,
  • 提供某种纹理映射支持(不确定我是否需要这个——我的编码还不够深入,不知道我是否需要一个库来做到这一点,或者 OpenGL ES 是否能够做到这一切我在这里需要的工作),和
  • 可用于商业销售的 Android 应用.

以下是我找到的一些库.

Here are a few of the libraries I've found.

我也乐于听取未列入此列表的其他人的消息.

I'm also open to hearing about others not included on this list.

推荐答案

你之前问过这个问题,但如果你还在寻找,我有一个很好的解决方案.

You asked this a while back but I have a good solution if you are still looking.

您可以轻松地将其转换为顶点、法线和纹理坐标的数组,而不是加载 obj 文件.有一个工具可以将 obj 文件转换为 c 头文件.之后您可以将输出转换为与 java 一起使用.应该不难.

Instead of loading an obj file, you can easily convert it into arrays for the vertices, normals and texture coordinates. There's a tool which converts obj files to c header files. You can convert the output to work with java afterwards. It shouldn't be hard.

http://www.heikobehrens.net/2009/08/27/obj2opengl/

这个解决方案很简单,头文件不会比 obj 文件在源代码中增加太多空间,并且编译时数据会更紧凑,它非常快,因为您可以立即渲染数据,它可以转换纹理坐标,您无需担心将其用于您的商业产品.

This solution is easy, the header files wont add much space in source code than the obj files and the data will be more compact when compiled, it's very fast since you have the data there ready to render straight away, it can convert texture coordinates and you don't need to worry about using it for your commercial products.

这篇关于Android OpenGL .OBJ 文件加载器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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