projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bd8c742
)
use fmod() when incrementing CubeRot
author
Brian Paul
<brian.paul@tungstengraphics.com>
Mon, 30 Jan 2006 15:35:35 +0000
(15:35 +0000)
committer
Brian Paul
<brian.paul@tungstengraphics.com>
Mon, 30 Jan 2006 15:35:35 +0000
(15:35 +0000)
progs/demos/gearbox.c
patch
|
blob
|
history
diff --git
a/progs/demos/gearbox.c
b/progs/demos/gearbox.c
index fa4cbe726fcf6f07a3b6ea0b35a63849cb9a140c..3a1662cd6251c9a3a3e9449c0523cba01bde3391 100644
(file)
--- a/
progs/demos/gearbox.c
+++ b/
progs/demos/gearbox.c
@@
-325,10
+325,9
@@
idle(void)
dt = t - t0;
t0 = t;
- GearRot += 70.0 * dt; /* 70 degrees per second */
- GearRot = fmod(GearRot, 360.0); /* prevents eventual overflow */
-
- CubeRot += 15.0 * dt;
+ /* fmod to prevent overflow */
+ GearRot = fmod(GearRot + 70.0 * dt, 360.0); /* 70 deg/sec */
+ CubeRot = fmod(CubeRot + 15.0 * dt, 360.0); /* 15 deg/sec */
glutPostRedisplay();
}