From: Diederick Niehorster Date: Sun, 18 Nov 2012 03:30:54 +0000 (+0000) Subject: small enhancements to shapes demo: X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=commitdiff_plain;h=a1341b0b3cbc2010781cf82d86ed60d5e0eb300a;p=freeglut small enhancements to shapes demo: - pitch and yaw rotation speeds are now prime numbers so we don't have a repeating cycle - made window slightly larger so we have more space for the info printed - added info for 2D rotation vs 1D rotation - added keys to info where they were missing git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@1400 7f0cb862-5218-0410-a997-914c9d46530a --- diff --git a/progs/demos/shapes/shapes.c b/progs/demos/shapes/shapes.c index c22c055..6942c77 100644 --- a/progs/demos/shapes/shapes.c +++ b/progs/demos/shapes/shapes.c @@ -604,8 +604,8 @@ resize(int width, int height) static void display(void) { const double t = glutGet(GLUT_ELAPSED_TIME) / 1000.0; - const double a = t*90.0; - const double b = (animateXRot?t:1)*60.0; + const double a = t*89.0; + const double b = (animateXRot?t:1)*67.0; glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); @@ -698,14 +698,19 @@ static void display(void) shapesPrintf (5, 1, "Outer radius Up Down : %f", orad); shapesPrintf (6, 1, "Inner radius Left Right: %f", irad); if (persProject) - shapesPrintf (7, 1, "Perspective projection"); + shapesPrintf (7, 1, "Perspective projection (p)"); else - shapesPrintf (7, 1, "Orthographic projection"); + shapesPrintf (7, 1, "Orthographic projection (p)"); if (useShader) - shapesPrintf (8, 1, "Using shader"); + shapesPrintf (8, 1, "Using shader (s)"); else - shapesPrintf (8, 1, "Using fixed function pipeline"); + shapesPrintf (8, 1, "Using fixed function pipeline (s)"); + if (animateXRot) + shapesPrintf (9, 1, "2D rotation (r)"); + else + shapesPrintf (9, 1, "1D rotation (r)"); } else { + /* print to command line instead */ printf ( "Shape %d slides %d stacks %d\n", function_index, slices, stacks ) ; } @@ -804,7 +809,7 @@ const GLfloat high_shininess[] = { 100.0f }; int main(int argc, char *argv[]) { - glutInitWindowSize(640,480); + glutInitWindowSize(800,600); glutInitWindowPosition(40,40); glutInit(&argc, argv); glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH | GLUT_MULTISAMPLE);