【问题标题】:Missing texture while loading .Obj blender file on android在android上加载.Obj blender文件时缺少纹理
【发布时间】:2011-10-01 01:51:19
【问题描述】:

我在搅拌机上做了我自己的自定义 3d 对象, 它是一个以地球贴图为纹理的简单 UV Sphere。

加载它并在搅拌机上渲染后,对象看起来没有纹理。

这是我的 mtl 文件:

newmtl Material.001
Ns 96.078431
d 1.000000
illum 2
map_Kd earth.jpg
Ka 0.000000 0.000000 0.000000
Kd 0.640000 0.640000 0.640000
Ks 0.500000 0.500000 0.500000
Ni 1.000000

我确保将所有内容都放在 res/drawble 目录中的“the earth.jpg”

这是我加载 obj 的代码

    IParser myParser = Parser.createParser(Parser.Type.OBJ, getResources(), "com.min3dtest:raw/earth_obj",true);
    myParser.parse();
    faceObject3D = myParser.getParsedObject();
    faceObject3D.position().x = faceObject3D.position().y = faceObject3D.position().z = 0;
    faceObject3D.scale().x = faceObject3D.scale().y = faceObject3D.scale().z = 0.009f; // Depending on the model you will need to change the scale         
    scene.addChild(faceObject3D);  

请大家帮忙看看有什么问题??

【问题讨论】:

标签: android opengl-es textures blender .obj


【解决方案1】:

你的纹理有 2 的幂吗? (例如:1024x512 而不是 1000x512)

【讨论】:

    猜你喜欢
    • 2016-07-19
    • 1970-01-01
    • 2011-09-28
    • 1970-01-01
    • 2013-08-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-10-12
    相关资源
    最近更新 更多