ピボットポイント(脚の上端)の周りを脚の動きをしようとすると、代わりに脚を前後に回転させたいときに、脚が間違ったポイントを中心に回転し始めます。足の動きを作る方法、OpenGL?
この問題を解決するにはどうすればよいですか?
これは私のコードです。
glPushMatrix();
glTranslatef(x+0.0f, y+6.0f, z-1.5f);
glRotatef(walk, 1.0f,0.0f,0.0f);
glBegin(GL_QUADS);
glTexCoord2f(0.5f,0.0f); glVertex3f(x-1.0f, y-6.0f, z-3.0f);
glTexCoord2f(1.0f,0.0f); glVertex3f(x-1.0f, y-6.0f, z-0.5f);
glTexCoord2f(1.0f,0.5f); glVertex3f(x-1.0f, y-18.0f, z-0.5f);
glTexCoord2f(0.5f,0.5f); glVertex3f(x-1.0f, y-18.0f, z-3.0f);
glTexCoord2f(0.5f,0.0f); glVertex3f(x+1.0f, y-6.0f, z-3.0f);
glTexCoord2f(1.0f,0.0f); glVertex3f(x+1.0f, y-6.0f, z-0.5f);
glTexCoord2f(1.0f,0.5f); glVertex3f(x+1.0f, y-18.0f, z-0.5f);
glTexCoord2f(0.5f,0.5f); glVertex3f(x+1.0f, y-18.0f, z-3.0f);
glTexCoord2f(0.5f,0.0f); glVertex3f(x-1.0f, y-6.0f, z-3.0f);
glTexCoord2f(1.0f,0.0f); glVertex3f(x+1.0f, y-6.0f, z-3.0f);
glTexCoord2f(1.0f,0.5f); glVertex3f(x+1.0f, y-18.0f, z-3.0f);
glTexCoord2f(0.5f,0.5f); glVertex3f(x-1.0f, y-18.0f, z-3.0f);
glTexCoord2f(0.5f,0.0f); glVertex3f(x-1.0f, y-6.0f, z-0.5f);
glTexCoord2f(1.0f,0.0f); glVertex3f(x+1.0f, y-6.0f, z-0.5f);
glTexCoord2f(1.0f,0.5f); glVertex3f(x+1.0f, y-18.0f, z-0.5f);
glTexCoord2f(0.5f,0.5f); glVertex3f(x-1.0f, y-18.0f, z-0.5f);
glEnd();
glPopMatrix();
glPushMatrix();
glTranslatef(x+0.0f, y+6.0f, z+1.5f);
glRotatef(-walk, 0.0f,0.0f,1.0f);
glBegin(GL_QUADS);
glTexCoord2f(0.5f,0.0f); glVertex3f(x-1.0f, y-6.0f, z+3.0f);
glTexCoord2f(1.0f,0.0f); glVertex3f(x-1.0f, y-6.0f, z+0.5f);
glTexCoord2f(1.0f,0.5f); glVertex3f(x-1.0f, y-18.0f, z+0.5f);
glTexCoord2f(0.5f,0.5f); glVertex3f(x-1.0f, y-18.0f, z+3.0f);
glTexCoord2f(0.5f,0.0f); glVertex3f(x+1.0f, y-6.0f, z+3.0f);
glTexCoord2f(1.0f,0.0f); glVertex3f(x+1.0f, y-6.0f, z+0.5f);
glTexCoord2f(1.0f,0.5f); glVertex3f(x+1.0f, y-18.0f, z+0.5f);
glTexCoord2f(0.5f,0.5f); glVertex3f(x+1.0f, y-18.0f, z+3.0f);
glTexCoord2f(0.5f,0.0f); glVertex3f(x-1.0f, y-6.0f, z+3.0f);
glTexCoord2f(1.0f,0.0f); glVertex3f(x+1.0f, y-6.0f, z+3.0f);
glTexCoord2f(1.0f,0.5f); glVertex3f(x+1.0f, y-18.0f, z+3.0f);
glTexCoord2f(0.5f,0.5f); glVertex3f(x-1.0f, y-18.0f, z+3.0f);
glTexCoord2f(0.5f,0.0f); glVertex3f(x-1.0f, y-6.0f, z+0.5f);
glTexCoord2f(1.0f,0.0f); glVertex3f(x+1.0f, y-6.0f, z+0.5f);
glTexCoord2f(1.0f,0.5f); glVertex3f(x+1.0f, y-18.0f, z+0.5f);
glTexCoord2f(0.5f,0.5f); glVertex3f(x-1.0f, y-18.0f, z+0.5f);
glEnd();
glPopMatrix();
だからあなたの質問は何ですか? –
は、代わりにhttp://gamedev.stackexchange.com/を試すことがあります。この種の質問に特化したサイト。 – Gorgen
物事は周りを回っていますか? –