X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=o2demo;a=blobdiff_plain;f=src%2Fparts%2Fexample.c;fp=src%2Fparts%2Fexample.c;h=8b9f58f84f847a3fd5a5a9e64238f2c2282ebd7d;hp=d52f20fd763bf8100dff0a132a66b39d4be8dd6c;hb=58f92d33490a85a5381eff6e54603ebbfb6ccd41;hpb=4b32bd7bc643379bd4a63c5714cec68c32a0c3c1 diff --git a/src/parts/example.c b/src/parts/example.c index d52f20f..8b9f58f 100644 --- a/src/parts/example.c +++ b/src/parts/example.c @@ -33,7 +33,7 @@ struct screen *example_screen(void) 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; @@ -64,10 +64,11 @@ static void draw(void) glMatrixMode(GL_MODELVIEW); glLoadIdentity(); - glMultMatrixf(sball_inv_matrix); - 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(); @@ -80,10 +81,10 @@ static void draw(void) 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(); @@ -100,6 +101,10 @@ static void draw(void) 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(); }