Todo update the physics by allowing the bike to

This preview shows page 6 - 14 out of 16 pages.

// TODO update the physics by allowing the bike to // accelerate due to gravity. glutPostRedisplay(); }
Image of page 6

Subscribe to view the full document.

Redrawing the Scene void display(void) { // clear buffers, set up matrix stack glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glLoadIdentity (); /* viewing transformation */ // move the bike-mounted camera depending on where the bike moved. gluLookAt (0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0); // redraw the terrain. Terrain doesn't change, // so this should be easy. displayTerrain (); // all done, swap the frames. glutSwapBuffers(); }
Image of page 7
Simplifying the Physics Preserve realistic game play Avoid simulating down to atomic physics
Image of page 8

Subscribe to view the full document.

Example: Simplifying the Physics pg ages/downhill-pic.jpg
Image of page 9
Simplified Model Rider position Wheel contact points Rotational force on uphill slopes Rotational force on downhill slopes Steering angle Motion vector
Image of page 10

Subscribe to view the full document.

Updating display and model
Image of page 11
Order of Transformations rotate translate!= translate rotate What does this draw? 1. glTranslatef (5.0, 0.0, 0.0); 2. glRotatef (45, 0.0, 0.0, 1.0); 3. glutCube (1.0);
Image of page 12

Subscribe to view the full document.

Transformations in OpenGL Each transformation modifies the matrix on the top of the matrix stack.
Image of page 13
Image of page 14
You've reached the end of this preview.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern