-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMouse.pde
33 lines (31 loc) · 856 Bytes
/
Mouse.pde
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
void mouseDragged() {
if (!cp5.isMouseOver()) {
if (isHoldingCtrl) {
rotationX -= (mouseY - pmouseY) / TWO_PI;
} else if (isHoldingShift) {
rotationY += (mouseX - pmouseX) / TWO_PI;
} else if (isHoldingAlt) {
rotationZ += (mouseX - pmouseX) / TWO_PI;
} else {
rotationX -= (mouseY - pmouseY) / TWO_PI;
rotationY += (mouseX - pmouseX) / TWO_PI;
rotationZ += (mouseX - pmouseX) / TWO_PI;
}
}
}
// zooming with the mouseWheel
void mouseWheel(int delta) {
if (delta > 0) {
if (zoom > 20) {
cp5.getController("zoom").setValue(zoom - 10);
} else {
cp5.getController("zoom").setValue(zoom - 1);
}
} else if (delta < 0) {
if (zoom >= 20) {
cp5.getController("zoom").setValue(zoom + 10);
} else {
cp5.getController("zoom").setValue(zoom + 1);
}
}
}