OpenGL Super Bible! (Top web site) Page 475 */ Roll +=

OpenGL Super Bible! Page 475 */ Roll += movex; Pitch += movey * cos(Roll * M_PI / 180.0); Heading += movey * sin(Roll * M_PI / 180.0); if (Heading < 0.0) Heading += 360.0; else if (Heading >= 360.0) Heading -= 360.0; if (Pitch < -180.0) Pitch += 360.0; else if (Pitch >= 180.0) Pitch -= 360.0; if (Roll < -180.0) Roll += 360.0; else if (Roll >= 180.0) Roll -= 360.0; /* * Move based upon the current orientation */ cheading = cos(Heading * M_PI / 180.0); sheading = sin(Heading * M_PI / 180.0); cpitch = cos(Pitch * M_PI / 180.0); spitch = sin(Pitch * M_PI / 180.0); Position[0] += distance * sheading * cpitch; Position[2] -= distance * cheading * cpitch; Position[1] += distance * spitch; /* * Redraw the window using the new position and orientation */ GetClientRect(SceneWindow, &rect); RepaintWindow(&rect); } /* * ‘RepaintWindow() - Redraw the client area with our scene. */ void RepaintWindow(RECT *rect) /* I - Client area rectangle */ { int i; /* Looping var */ int x, y; /* Terrain (x,y) location */ int last_type; /* Previous terrain type */ int *type; /* Current terrain type */ GLfloat *height, /* Current terrain height */ (*n)[3]; /* Current terrain normal */
Searching for affordable and reliable webhost to host and run your web applications? Go to our java web server services and you will be pleased.

Leave a Reply