public void onDrawFrame(GL10 gl){
  gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
  gl.glMatrixMode(GL10.GL_MODELVIEW);
  gl.glLoadIdentity();
  if (showCubeInsideOut) {
    float dist=3;
    gl.glTranslatef(0,0,-dist);
    if (orientationProvider != null) {
      Quaternion q=orientationProvider.getQuaternion();
      gl.glRotatef((float)(2.0f * Math.acos(q.getW()) * 180.0f / Math.PI),q.getX(),q.getY(),q.getZ());
    }
    gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);
    gl.glEnableClientState(GL10.GL_COLOR_ARRAY);
    mCube.draw(gl);
  }
 else {
    if (orientationProvider != null) {
      Quaternion q=orientationProvider.getQuaternion();
      gl.glRotatef((float)(2.0f * Math.acos(q.getW()) * 180.0f / Math.PI),q.getX(),q.getY(),q.getZ());
    }
    float dist=3;
    drawTranslatedCube(gl,0,0,-dist);
    drawTranslatedCube(gl,0,0,dist);
    drawTranslatedCube(gl,0,-dist,0);
    drawTranslatedCube(gl,0,dist,0);
    drawTranslatedCube(gl,-dist,0,0);
    drawTranslatedCube(gl,dist,0,0);
  }
  gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);
  gl.glEnableClientState(GL10.GL_COLOR_ARRAY);
  mCube.draw(gl);
}

public void onDrawFrame ( GL10 gl ) { gl . glClear ( GL10 . GL_COLOR_BUFFER_BIT ) ; gl . glMatrixMode ( GL10 . GL_MODELVIEW ) ; gl . glLoadIdentity ( ) ; if ( showCubeInsideOut ) { float dist = 3 ; gl . glTranslatef ( 0 , 0 , - dist ) ; if ( orientationProvider != null ) { Quaternion q = orientationProvider . getQuaternion ( ) ; gl . glRotatef ( ( float ) ( 2.0f * Math . acos ( q . getW ( ) ) * 180.0f / Math . PI ) , q . getX ( ) , q . getY ( ) , q . getZ ( ) ) ; } gl . glEnableClientState ( GL10 . GL_VERTEX_ARRAY ) ; gl . glEnableClientState ( GL10 . GL_COLOR_ARRAY ) ; mCube . draw ( gl ) ; } else { if ( orientationProvider != null ) { Quaternion q = orientationProvider . getQuaternion ( ) ; gl . glRotatef ( ( float ) ( 2.0f * Math . acos ( q . getW ( ) ) * 180.0f / Math . PI ) , q . getX ( ) , q . getY ( ) , q . getZ ( ) ) ; } float dist = 3 ; drawTranslatedCube ( gl , 0 , 0 , - dist ) ; drawTranslatedCube ( gl , 0 , 0 , dist ) ; drawTranslatedCube ( gl , 0 , - dist , 0 ) ; drawTranslatedCube ( gl , 0 , dist , 0 ) ; drawTranslatedCube ( gl , - dist , 0 , 0 ) ; drawTranslatedCube ( gl , dist , 0 , 0 ) ; } gl . glEnableClientState ( GL10 . GL_VERTEX_ARRAY ) ; gl . glEnableClientState ( GL10 . GL_COLOR_ARRAY ) ; mCube . draw ( gl ) ; }
perform the actual rendering of the cube for each frame
