static int init(void)
{
- if(gen_torus_mesh(&torus, 1.0f, 0.35, 24, 12) == -1) {
+ if(gen_torus_mesh(&torus, 1.0f, 0.15, 24, 12) == -1) {
return -1;
}
return 0;
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
- glTranslatef(0, 0, -cam_dist);
+ /*glTranslatef(0, 0, -cam_dist);
glRotatef(cam_phi, 1, 0, 0);
- glRotatef(cam_theta, 0, 1, 0);
+ glRotatef(cam_theta, 0, 1, 0);*/
+
+ glMultMatrixf(sball_cam_matrix);
/* draw floor */
glPushMatrix();
glBegin(GL_QUADS);
glNormal3f(0, 1, 0);
- glVertex3f(-2, 0, 2);
- glVertex3f(2, 0, 2);
- glVertex3f(2, 0, -2);
- glVertex3f(-2, 0, -2);
+ glVertex3f(-4, 0, 4);
+ glVertex3f(4, 0, 4);
+ glVertex3f(4, 0, -4);
+ glVertex3f(-4, 0, -4);
glEnd();
glPopMatrix();
glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, color);
draw_mesh(&torus);
+ glRotatef(90, 1, 0, 0);
+ draw_mesh(&torus);
+ glRotatef(90, 0, 0, 1);
+ draw_mesh(&torus);
glPopMatrix();
}