0
OpenGL 2.0에서 눈사람을 만들고 싶습니다. 전체 도형을 회전하고 싶지만 프로그램을 실행할 때마다 작동하지 않습니다.여러 개체 OpenGL에서 회전
glPushMatrix();
//bottom sphere
glTranslated(tranX,tranY-2,tranZ);
glRotated(rotX,1,0,0);
glRotated(rotY,0,1,0);
glRotated(rotZ,0,0,1);
glScaled(scaX,scaY,scaZ);
glColor3f(1.1,.7,.99);
glutSolidSphere(1.5,30,30);
//middle sphere
glTranslated(tranX,tranY+2.3,tranZ+8);
glRotated(rotX,1,0,0);
glRotated(rotY,0,1,0);
glRotated(rotZ,0,0,1);
glScaled(scaX,scaY,scaZ);
glColor3f(1.1,.7,.99);
glutSolidSphere(1.3,30,30);
//top sphere
glTranslated(tranX,tranY+2,tranZ+10);
glRotated(rotX,1,0,0);
glRotated(rotY,0,1,0);
glRotated(rotZ,0,0,1);
glScaled(scaX,scaY,scaZ);
glColor3f(1.1,.7,.99);
glutSolidSphere(1,30,30);
glPopMatrix();
'작동하지 않는 것'보다 구체적 일 수 있습니까? – icktoofay
대답은 이미 주어졌지만 추천을 추가하고 싶다 : 오래된 고정 함수 파이프 라인을 피하고 glm (http://glm.g-truc.net/)을 사용하여 작은 씬 그래프를 만들 수있다. 엔진. – dinony