Exemplo n.º 1
0
            public void onDrawFrame(GL10 gl)
            {
                // clear the color buffer and the depth buffer
                gl.glClear(GL10_GL_COLOR_BUFFER_BIT | GL10_GL_DEPTH_BUFFER_BIT);

                gl.glVertexPointer(3, GL10_GL_FLOAT, 0, _vertexBuffer);
                gl.glColorPointer(4, GL10_GL_FLOAT, 0, _colorBuffer);

                for (int i = 1; i <= 10; i++)
                {
                    gl.glLoadIdentity();
                    gl.glTranslatef(0.0f, -1f, -1.0f + -1.5f * i);
                    // set rotation
                    gl.glRotatef(_xAngle, 1f, 0f, 0f);
                    gl.glRotatef(_yAngle, 0f, 1f, 0f);
                    gl.glDrawElements(GL10_GL_TRIANGLES, _nrOfVertices, GL10_GL_UNSIGNED_SHORT, _indexBuffer);
                }
            }
            public void onDrawFrame(GL10 gl)
            {
                // clear the color buffer and the depth buffer
                gl.glClear(GL10_GL_COLOR_BUFFER_BIT | GL10_GL_DEPTH_BUFFER_BIT);

                gl.glVertexPointer(3, GL10_GL_FLOAT, 0, _vertexBuffer);
                gl.glColorPointer(4, GL10_GL_FLOAT, 0, _colorBuffer);

                for (int i = 1; i <= 10; i++)
                {
                    gl.glLoadIdentity();
                    gl.glTranslatef(0.0f, -1f, -1.0f + -1.5f * i);
                    // set rotation
                    gl.glRotatef(_xAngle, 1f, 0f, 0f);
                    gl.glRotatef(_yAngle, 0f, 1f, 0f);
                    gl.glDrawElements(GL10_GL_TRIANGLES, _nrOfVertices, GL10_GL_UNSIGNED_SHORT, _indexBuffer);
                }
            }