tex1 = loadTexture(gl, bmp0);
tex2 = loadTexture(gl, bmp1);
tex3 = loadTexture(gl, bmp2);
tex4 = loadTexture(gl, bmp3);
tex5 = loadTexture(gl, bmp4);
....
gl.glBindTexture(GL10.GL_TEXTURE_2D, tex);
gl.glEnable(GL10.GL_TEXTURE_2D);
gl.glMaterialfv(GL10.GL_FRONT_AND_BACK, GL10.GL_AMBIENT,
matAmbient,
0);
gl.glMaterialfv(GL10.GL_FRONT_AND_BACK, GL10.GL_DIFFUSE,
matDiffuse,
0);
gl.glVertexPointer(3, GL10.GL_FLOAT, 0, cubeBuff);
gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);
gl.glEnableClientState(GL10.GL_TEXTURE_COORD_ARRAY);
gl.glTexCoordPointer(2, GL10.GL_FLOAT, 0, texBuff);
gl.glNormal3f(0,0,1);
gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 0, 4);
gl.glBindTexture(GL10.GL_TEXTURE_2D, tex1);
gl.glNormal3f(0,0,-1);
gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 4, 4);
gl.glBindTexture(GL10.GL_TEXTURE_2D, tex2);
gl.glNormal3f(-1,0,0);
gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 8, 4);
gl.glBindTexture(GL10.GL_TEXTURE_2D, tex3);
gl.glNormal3f(1,0,0);
gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 12, 4);
gl.glBindTexture(GL10.GL_TEXTURE_2D, tex4);
gl.glNormal3f(0,1,0);
gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 16, 4);
gl.glBindTexture(GL10.GL_TEXTURE_2D, tex5);
gl.glNormal3f(0,-1,0);
gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 20, 4);
in the above context,when the bmp,bmp1,bmp2,...,bmp5 all be modified
to bmp ,there will be no problem,otherwise there will be "force
close"exception.and why?
best wishes!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Android Discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---