Commits

Cliff Biffle committed 1e67c5c

Changed the sinusoidal point cloud to a mesh of lines.

Comments (0)

Files changed (1)

   glVertex3f(0, 0, 1);
   glEnd();
   
-  glBegin(GL_POINTS);
+  glBegin(GL_LINES);
   glColor3f (1.0, 0.5, 0.0);
-  for (int y = 0; y < 480; y++) {
-    for (int x = 0; x < 640; x++) {
-      glVertex3f(x, y, sin(x*3.14159/180));
+  for (int y = 0; y < 479; y++) {
+    for (int x = 0; x < 639; x++) {
+      GLfloat d1 = sin(x*3.14159/180), d2 = sin((x+1)*3.14159/180);
+      glVertex3f(x, y, d1);
+      glVertex3f(x, y+1, d1);
+      glVertex3f(x+1, y+1, d2);
+      glVertex3f(x+1, y, d2);
     }
   }
   glEnd();