seed r781 - trunk/examples/opengl
- From: racarr svn gnome org
- To: svn-commits-list gnome org
- Subject: seed r781 - trunk/examples/opengl
- Date: Tue, 20 Jan 2009 20:13:26 +0000 (UTC)
Author: racarr
Date: Tue Jan 20 20:13:26 2009
New Revision: 781
URL: http://svn.gnome.org/viewvc/seed?rev=781&view=rev
Log:
Some small fixes to gears rendering
Modified:
trunk/examples/opengl/seed-gears.js
Modified: trunk/examples/opengl/seed-gears.js
==============================================================================
--- trunk/examples/opengl/seed-gears.js (original)
+++ trunk/examples/opengl/seed-gears.js Tue Jan 20 20:13:26 2009
@@ -29,18 +29,18 @@
GL.Begin(GL.QUADS);
da = 2.0 * Math.PI / teeth / 4.0;
for (var i = 0; i < teeth; i++) {
- var angle = i * 2.0 * Math.PI / teeth;
-
- GL.Vertex3f(r1 * Math.cos(angle), r1 * Math.sin(angle),
- width * 0.5);
- GL.Vertex3f(r2 * Math.cos(angle + da), r2 * Math.sin(angle + da),
- width * 0.5);
- GL.Vertex3f(r2 * Math.cos(angle + 2 * da),
+ var angle = (i) * 2.0 * Math.PI / teeth;
+
+ GL.Vertex3f(r2 * Math.cos(angle + 2 * da),
r2 * Math.sin(angle + 2 * da), width * 0.5);
GL.Vertex3f(r1 * Math.cos(angle + 3 * da),
r1 * Math.sin(angle + 3 * da), width * 0.5);
+ GL.Vertex3f(r1 * Math.cos(angle), r1 * Math.sin(angle), width * 0.5);
+ GL.Vertex3f(r2 * Math.cos(angle + da),
+ r2 * Math.sin(angle + da), width * 0.5);
}
- GL.End();
+ GL.End();
+
GL.Normal3f(0.0, 0.0, -1.0);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]