Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // The purpose of this function is to draw the objects to the screen
- void Draw()
- {
- glMatrixMode(GL_PROJECTION); // set the view volume shape
- glLoadIdentity();
- glOrtho(-worldx, worldx, -worldy, worldy, 0.1, 100);
- glMatrixMode(GL_MODELVIEW); // position and aim the camera
- glLoadIdentity();
- gluLookAt(eyeX, eyeY, eyeZ, centerX, centerY, centerZ, upX, upY, upZ);
- // Check if user inputs 'i' or 'I' from the keyboard
- if (original)
- {
- OriginalView();
- original = false;
- }
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // clear the screen
- for (int i=0; i<37; i++)
- {
- GLfloat mat_ambient[] = {0.0, 0.5, 0.8, 1.0 };
- glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient);
- cancer.DrawNormalCell(cancer.v[i].x,cancer.v[i].y,cancer.v[i].z);
- }
- if (drawCancer)
- {
- for (int i=0; i<37; i++)
- {
- GLfloat mat_ambient[] = {0.8, 0.0, 0.2, 1.0 };
- glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient);
- cancer.DrawCancerCell(cancer.v[19].x,cancer.v[19].y,cancer.v[19].z);
- }
- glutSwapBuffers();
- }
Add Comment
Please, Sign In to add comment