简体   繁体   English

使用min3D在Android上渲染导出的3D对象

[英]Rendering exported 3D objects on Android using min3D

I'm creating a bike racing game for Android. 我正在为Android创建一个赛车游戏。 I am planning to create models in Blender, export them to .obj format and then render them on the device. 我打算在Blender中创建模型,将其导出为.obj格式,然后在设备上呈现它们。 I'm using the min3D framework to do the obj parsing and rendering. 我正在使用min3D框架进行obj解析和渲染。 I followed the tutorial in this page for parsing the obj file and to render it on the screen. 我按照本页中的教程进行操作,以解析obj文件并将其呈现在屏幕上。 When I tried simple object like a cube, everything works fine and it is rendered perfectly on the screen. 当我尝试简单的对象(如多维数据集)时,一切正常,并且可以在屏幕上完美呈现。 But when I tried to load a simple bike model I downloaded from the web, it doesn't work. 但是,当我尝试加载从网络上下载的简单自行车模型时,它不起作用。 The app crashes and I force stop it. 该应用程序崩溃了,我强行停止了它。 When I saw LogCat, it was either a java.lang.NumberFormatException, or java.lang.NullPointerException or a resource not found exception inside the parse() method. 当我看到LogCat时,它是java.lang.NumberFormatException或java.lang.NullPointerException或parse()方法内找不到资源的异常。 I have no clue why this happens. 我不知道为什么会这样。

I have the following doubts about where it possibly could have gone wrong: 我对它可能在哪里出错有以下疑问:

1) According to the given tutorial, I changed the file names from .obj and .mtl to _obj and _mtl. 1)根据给定的教程,我将文件名从.obj和.mtl更改为_obj和_mtl。 But there was a line in the obj file that has the name of the .mtl file. 但是obj文件中有一行名称为.mtl文件的行。 I changed it to _mtl. 我将其更改为_mtl。 Still it dint work. 仍然可以完成工作。 Is there something similar I need to do anywhere else? 还有其他地方需要做的类似事情吗? Do I need to modify any of the files in any way? 我需要以任何方式修改任何文件吗?

2) Sometimes I find that models created in Blender 2.49 are parsed and rendered but the models created in Blender 2.6 are causing this trouble. 2)有时我发现在Blender 2.49中创建的模型已被解析和渲染,但是在Blender 2.6中创建的模型引起了这种麻烦。 Also min3D was created during the older versions of Blender. 在早期版本的Blender中也创建了min3D。 So should I use only Blender 2.49 for creating the models and rendering them? 所以我应该只使用Blender 2.49创建模型并渲染它们吗?

PS: I'm completely new to graphics so I'm fighting a lot with this without giving up. PS:我对图形完全陌生,因此我为此付出了很多努力,而没有放弃。 Any help would be greatly appreciated. 任何帮助将不胜感激。 :) :)

I believe this is because of missing Texture. 我相信这是因为缺少Texture。 Did you copy the texture image into res/drawable folder? 您是否将纹理图像复制到res / drawable文件夹中?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM