je fais ça mais il bouge n'importe comment !!
void mouseMotion(int x, int y) {
view_roty += ((glutGet(GLUT_WINDOW_WIDTH) + x)/100)%360;
view_rotx += ((glutGet(GLUT_WINDOW_HEIGHT) + y)/100)%360;
printf("Souris x=%i, y=%i, screen height = %i, screen width = %i\n", x, y, glutGet(GLUT_WINDOW_HEIGHT), glutGet(GLUT_WINDOW_WIDTH));
}
void redraw() {
...
glRotatef(view_rotx, 1.0, 0.0, 0.0);
glRotatef(view_roty, 0.0, 1.0, 0.0);
glRotatef(view_rotz, 0.0, 0.0, 1.0);
glTranslatef(0.0f, 0.0f, distance+18.0f);
...
};
Y'a-t-il un dieu de l'openGL (et GLUT) parmi vous ?
---------------
Chết rồi ! ✍ ⌥⌘ http://github.com/gwenhael-le-moine/slackbuilds/