0
구를 그리는 다음과 같은 drawScene 함수가 있습니다. X, Y의 좌표는 항상 업데이트됩니다. 늘어나는만큼 printf에서 볼 수있는 값이 확실히 바뀌 었습니다.OpenGL이 drawview를 업데이트하지 않습니다.
문제는 구가 ...
void drawScene(void){
//Clear information from last draw
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glMatrixMode(GL_MODELVIEW); //Switch to the drawing perspective
glLoadIdentity(); //Reset the drawing perspective
glColor3d(1,0,0);
//glPushMatrix();///
glTranslated(X,Y,-7);//xyz//(X%5)-2.5,Y%5//(((X%6)-3),0,-7)
printf("\n\n\nCOORDS(X)%d (Y):%d\n\n\n\n",X,Y);
glutSolidSphere(0.3, 25, 20);//3,20,20
//glPopMatrix();///
glutSwapBuffers(); //Send the 3D scene to the screen
}
PS를 좌표에 따라 위치를 변경하지 않고 항상 같은 장소에 그려진 것입니다. 이게 맞는지 확실하지 않지만 openGL 윈도우를 업데이트해야 할 때마다 drawScene()을 호출하거나 그렇지 않으면 한 번만 그려집니다.
당신이 우리에게 전화 사이트를 보여줄 수 이 함수의? –