Android的OpenGL的.OBJ文件加载器加载、文件、Android、OpenGL

2023-09-07 17:10:01 作者:柠檬味的猫

似乎有相当多的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的就可以做的一切工作,我需要在这里),和 可以在被商业销售的Andr​​oid应用程序中使用。

下面是一些我发现的库。

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

Min3D .OBJ装载机为Android 随机 objloader 上的 anddev.org论坛 的Andr​​oid-GL LibGDX Min3D .obj Loader for Android Random objloader found on anddev.org forum Android-GL LibGDX

我也开放给听到别人没有列入这个名单上。谢谢!

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

推荐答案

您问这个而回,但我有一个很好的解决方案,如果你还在寻找。

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/

这个解决方案很容易,头文件惯于源$ C ​​$ C增加多少空间比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.