meshing calculation for co-planar gears
[antikythera] / src / main.cc
index b5d430b..7efc114 100644 (file)
@@ -7,6 +7,7 @@
 #else
 #include <GL/glut.h>
 #endif
+#include "app.h"
 #include "machine.h"
 
 bool init();
@@ -19,7 +20,7 @@ void keyb(unsigned char key, int x, int y);
 void mouse(int bn, int st, int x, int y);
 void motion(int x, int y);
 
-static float cam_dist = 2;
+static float cam_dist = 0.5;
 static float cam_theta, cam_phi;
 static int prev_mx, prev_my;
 static bool bnstate[8];
@@ -127,7 +128,7 @@ void idle()
 
 void draw_gears()
 {
-       /* world scale is in meters, gears are in millimeters, sclae by 1/1000 */
+       /* world scale is in meters, gears are in millimeters, scale by 1/1000 */
        glPushMatrix();
        glScalef(0.001, 0.001, 0.001);
 
@@ -142,7 +143,7 @@ void reshape(int x, int y)
 
        glMatrixMode(GL_PROJECTION);
        glLoadIdentity();
-       gluPerspective(50.0, (float)x / (float)y, 0.05, 100.0);
+       gluPerspective(50.0, (float)x / (float)y, 0.01, 100.0);
 }
 
 void keyb(unsigned char key, int x, int y)
@@ -150,6 +151,11 @@ void keyb(unsigned char key, int x, int y)
        switch(key) {
        case 27:
                exit(0);
+
+       case 'w':
+               opt_gear_wireframe = !opt_gear_wireframe;
+               glutPostRedisplay();
+               break;
        }
 }