OpenGL에서 객체가 4 가지 다른 객체를 드래그하는 방법을 궁금해합니다. 이 객체들을 그리는 아주 간단한 코드를 가지고 있습니다 :C++ OpenGL은 마우스로 여러 객체를 드래그
glPushMatrix();
glTranslatef(mouse_x, mouse_y, 0);
glutSolidIcosahedron();
glPopMatrix();
glPushMatrix();
glTranslatef(mouse_x2, mouse_y2, 0);
glutSolidIcosahedron();
glPopMatrix();
glPushMatrix();
glTranslatef(mouse_x3, mouse_y3, 0);
glutSolidIcosahedron();
glPopMatrix();
glPushMatrix();
glTranslatef(mouse_x4, mouse_y4, 0);
glutSolidIcosahedron();
glPopMatrix();
나는 객체를 움직이는 방법을 알고 있지만,이 객체들 중 하나를 드래그 앤 드롭하는 법을 배우고 싶습니다. 이름 스택 및 선택 모드에 대해 조사해 왔지만 혼란 스러웠습니다. 그리고 glutMouseFunc와 같은 일을해야한다는 것도 알고 있습니다. 내가 헷갈리는 각 모양을 선택하는 것입니다.
감사합니다. –