Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void RenderBrain(void)
- {
- glClear(GL_COLOR_BUFFER_BIT);
- glMatrixMode(GL_MODELVIEW);
- ifstream myFile("brainData.txt");
- if (!myFile.is_open())
- {
- cout << "Unable to open file";
- exit(1); // terminate with error
- }
- glRotatef(80.0f, 1.0f, 0.0f, 0.0f);
- while (! myFile.eof())
- {
- myFile>>a[0];
- myFile>>a[1];
- myFile>>a[2];
- myFile>>a[3];
- glColor3f(0.60f,0.80f,0.90f);
- glLoadIdentity();
- glTranslatef((a[0]-1.15)*26, a[2]*30, a[1]*30);
- glutSolidSphere(6, 5, 5);
- }
- myFile.close();
- glFlush();
- glutSwapBuffers();
- }
- glPushMatrix();
- glTranslatef((a[0]-1.15)*26, a[2]*30, a[1]*30);
- glutSolidSphere(6, 5, 5);
- glPopMatrix();
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
- angle += angularVelocity * deltaTime;
- glRotate(angle, 1, 0, 0);
- glLoadIdentity();
- glRotatef(80.0f, 1.0f, 0.0f, 0.0f);
- glTranslatef((a[0]-1.15)*26, a[2]*30, a[1]*30);
- glutSolidSphere(6, 5, 5);
Add Comment
Please, Sign In to add comment