I am following the tutorials at http://www3.ntu.edu.sg/home/ehchua/programming/android/Android_3D.html and I ran into a problem.
I managed to find both of the following examples:
2.7 Example 5: 3D shapes - a rotating color cube and a pyramid (Nehe Lesson 5: 3D Shapes) Example 2: Cube2.java
2.8 Example 6: Texture (Her Lesson 6: Texture)
But when I try to draw both a color cube and a textured cube, I get the following:
http://i.imgur.com/Smbsa.png
(The first part of the image)
The color cube is invisible, but it grips the texture cube, and the texture cube textures are painted with the last color (yellow) of the color cube.
I basically just draw both cubes with:
gl.glLoadIdentity();
gl.glTranslatef(0.0f, 0.0f, -6.0f);
gl.glScalef(0.5f, 0.5f, 0.5f);
gl.glRotatef(angleCube, 1.0f, 1.0f, 0.0f);
cube.draw(gl);
angleCube += speedCube;
gl.glLoadIdentity();
gl.glTranslatef(-1.0f, 0.0f, -6.0f);
gl.glScalef(0.5f, 0.5f, 0.5f);
gl.glRotatef(angleCube, 1.0f, 1.0f, 0.0f);
texturecube.draw(gl);
"" "2.9 6a: -".
( 2 , imgur )
:
gl.glColor4f(0.0f, 0.0f, 1.0f, 1.0f);
, "" .
:
gl.glColor4f(1.0f, 1.0f, 1.0f, 0.0f);
, .
:
texturecube.loadTexture(gl, context); // Load image into Texture (NEW)
photocube.loadTexture(gl); // Load image into Texture (NEW)
gl.glEnable(GL10.GL_TEXTURE_2D); // Enable texture (NEW)
:
( 2 , imgur )
.
:
, ? ( , )
"" /, "gl.glColor4f (1.0f, 1.0f, 1.0f, 0.0f);"?