我通过禁用将纹理发送到本机代码的 getProductTexture() 解决了歧义问题。现在我可以在主 Activity 和渲染 Activity 中应用纹理。为了动态更新纹理,我使用了 jpct-ae 的 ReplaceTexture()。以下是代码片段(我不确定这是最好的方法,但对我来说效果很好)\ try { modelstrm = new FileInputStream(new File(imagePath));
texstrm = new FileInputStream(new File(TexturePath));
System.out.println("Start loading crab md2 model");
try {
System.out.println("Start loading Texture");
TextureManager tm = TextureManager.getInstance();
if(!tm.containsTexture("new_texture")){
new_texture = new Texture(BitmapHelper.rescale(BitmapHelper.loadImage(texstrm), 512, 512));
tm.addTexture("new_texture", new_texture);
}
else{
old_texture = new Texture(BitmapHelper.rescale(BitmapHelper.loadImage(texstrm), 512, 512));
tm.replaceTexture("new_texture", old_texture);
}
System.out.println("End loading Texture");
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}