Invité Invité
| Sujet: ihm2 Jeu 6 Mar - 14:11 | |
| - Code:
-
void GLWidget::rotateBy(int xAngle, int yAngle, int zAngle) { xRot+=xAngle; yRot+=yAngle; zRot+=zAngle;
printf("rotby x%i y%i z%i\n", xAngle, yAngle, zAngle);
updateGL(); } void GLWidget::mousePressEvent( QMouseEvent * event ) { point=event->pos(); /* point.setX(event->x()); point.setY(event->y()); */ } void GLWidget::mouseMoveEvent( QMouseEvent * event ) { int dx,dy; dx=event->x()-point.x(); dy=event->y()-point.y(); if (event->buttons()==Qt::LeftButton) { rotateBy(8 * dy, 8 * dx, 0); } else if (event->buttons()==Qt::RightButton) { rotateBy(8 * dy, 0, 8 * dx); } }
|
|
titedame Admin
Messages : 249 Date d'inscription : 24/10/2007 Age : 38 Localisation : lagord/bordeaux
| Sujet: Re: ihm2 Jeu 6 Mar - 18:45 | |
| MERCI A TOI C'EST VRAIMENT TRES GENTIL | |
|
Max
Messages : 89 Date d'inscription : 24/10/2007 Age : 38 Localisation : La Rochelle-Auxerre
| Sujet: Re: ihm2 Ven 7 Mar - 0:35 | |
| Y'en a qui veulent de la mousse au chocolat ... | |
|