我正在尝试从程序中加载具有自定义纹理的3d obj模型。当我给基本形状的纹理
@Override
public void initScene() {
scene.lights().add(new Light());
objModel=new Box(1.5f,1.5f,1.5f);
scene.addChild(objModel);
/*IParser parser = Parser.createParser(Parser.Type.OBJ, getResources(), "com.example.yudhisthirgauli.modelloader:raw/andy", true);
parser.parse();
objModel = parser.getParsedObject();
objModel.scale().x = objModel.scale().y = objModel.scale().z = 10f;*/
//objModel.position().y = -20;
Bitmap b= Utils.makeBitmapFromResourceId(this,R.drawable.barong);
Shared.textureManager().addTextureId(b,"barong",false);
b.recycle();
TextureVo texture = new TextureVo("barong");
objModel.textures().add(texture);
scene.addChild(objModel);
scene.camera().target = objModel.position();
}
我能够加载纹理..但是当我使用Iparser用TextureVo加载obj模型时。我无法将其加载到模型中。