#include <math.h>
#include <float.h>
#include <assert.h>
+#include "opengl.h"
#include "machine.h"
static float delta_angle(float a, float b);
for(size_t i=0; i<gears.size(); i++) {
gears[i]->draw();
}
+
+ float dcol[] = {0.4, 0.4, 0.4, 1.0};
+ float scol[] = {0, 0, 0, 0};
+ glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, dcol);
+ glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, scol);
+
+ glBegin(GL_QUADS);
+ glNormal3f(0, 1, 0);
+ glVertex3f(-300, -100, 300);
+ glVertex3f(300, -100, 300);
+ glVertex3f(300, -100, -300);
+ glVertex3f(-300, -100, -300);
+ glEnd();
}
Gear *Machine::intersect_gear(const Ray &ray, HitPoint *hitp) const