I have a cube, I can assign for it one texture, but I would like to assign different texture for each face. I have a 512x512 texture atlas, with four tiles, each 256x256. I use the NeHe ports, so for one texture the load is:
public void loadGLTexture(GL10 gl, Context context) {
InputStream is = context.getResources().openRawResource(R.drawable.test);
Bitmap bitmap = null;
try {
bitmap = BitmapFactory.decodeStream(is);
} finally {
try {
is.close();
is = null开发者_高级运维;
} catch (IOException e) {
}
}
I have tried to find solutions, but I was not able to find with texture atlas, only with loading as much texture as I want to use, then assign them to the faces, but because of the performance it's not really good for me. I hope someone can help me! Thanks in advance!
PS: Which is faster, creating a cube with the coordinates writing in the code, or loading a cube model from an .obj file?
精彩评论