10 static int init(void);
11 static void destroy(void);
12 static void start(long trans_time);
13 static void draw(void);
15 static struct screen scr = {
23 static float cam_theta = -29, cam_phi = 20;
24 static float cam_dist = 6;
26 static struct g3d_mesh torus;
28 struct screen *example_screen(void)
36 if(gen_torus_mesh(&torus, 1.0f, 0.15, 24, 12) == -1) {
42 static void destroy(void)
46 static void start(long trans_time)
48 glEnable(GL_LIGHTING);
52 static void update(void)
56 static void draw(void)
58 float color[4] = {1, 1, 1, 1};
59 float t = (float)time_msec / 10.0f;
63 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
65 glMatrixMode(GL_MODELVIEW);
67 /*glTranslatef(0, 0, -cam_dist);
68 glRotatef(cam_phi, 1, 0, 0);
69 glRotatef(cam_theta, 0, 1, 0);*/
71 glMultMatrixf(sball_cam_matrix);
75 glTranslatef(0, -1, 0);
80 glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, color);
87 glVertex3f(-4, 0, -4);
94 glTranslatef(0, 0.35, 0);
95 glRotatef(t, 0, 1, 0);
96 glRotatef(t, 1, 0, 0);
101 glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, color);
104 glRotatef(90, 1, 0, 0);
106 glRotatef(90, 0, 0, 1);