public void onSurfaceCreated(GL10 gl, EGLConfig config) {
world = new World();
world.setAmbientLight(150, 150, 150);
TextureManager.getInstance().addTexture("tris3", new Texture(BitmapFactory.decodeResource(this.getResources(), R.drawable.tris3)));
snork = Loader.loadMD2(LoadAssets.loadf("tris3.md2"), scale);
snork.setTexture("tris3");
snork.strip();
snork.build();
world.addObject(snork);
}
public void onSurfaceChanged(GL10 gl, int width, int height) {
if (fb != null) {
fb = null;
}
this.width=width;
this.height=height;
fb = new FrameBuffer(gl,width, height);
}
onDrawFrame(GL10 gl) {
doAnim();
world.renderScene(fb);
world.draw(fb);
fb.display();
}
above is my key code to show texture,the md2 model loading is ok and the camera vedio as the background but the texture can't show on the model,I don't know what wrong is?if I change the OnDrawFrame(GL10 gl) function to below:
OnDrawFrame(GL10 gl) {
fb=new FrameBuffer(gl, this.getWidth(),this.getHeight());
doAnim();
world.renderScene(fb);
world.draw(fb);
fb.display();
}
run above code,it can see the texure on the model but it can't show the camera as the background,the background is just black!!
Please help me ?