2011-01-20 26 views

答えて

1

あなたondrawで、GLと呼ばれるのOpenGL ES GL10オブジェクトをしていると仮定すると、または類似:彼らはアンドロイドでOpenGLを開始する華麗なガイドがあるように私はthe android ports of the nehe opengl tutorialsを見てお勧め

// Push matrix so we can pop later 
    gl.glPushMatrix(); 

    // Translate to the center of your cube 
    // Or to whatever xyz point you want 
    glTranslatef(centreX, centreY, 0); 

    // rotation = degrees to rotate 
    // x,y,z are unit vectors for rotation to take place 
    // I.E x=0.0 y=0.0 z=0.0 would rotate around the z-axis 
    gl.glRotatef(rotation, x, y, z); 


    // CUBE DRAWING FUNCTION HERE 


    // Popmatrix so we undo translation and rotation for 
    // rest of opengl calls 
    gl.glPopMatrix(); 

+0

Z軸上では、キューブの中心で回転しますが、x軸、y軸上では回転しません。そのようにして、中心点はキューブの中心にはありませんが、それ以外は中心です。 – lacas

+0

上記のコードを追加して、問題の内容を確認してください。 – stealthcopter

関連する問題