/* Print info about the about the current shape and render state on the screen */ static void DrawSizeInfo(int *row) { switch (table [function_index].drawSizeInfoFlag) { case GEO_NO_SIZE: break; case GEO_SIZE: shapesPrintf ((*row)++, 1, "Size Up Down : %f", orad); break; case GEO_SCALE: shapesPrintf ((*row)++, 1, "Scale Up Down : %f", orad); break; case GEO_INNER_OUTER_RAD: shapesPrintf ((*row)++, 1, "Inner radius Left Right: %f", irad); shapesPrintf ((*row)++, 1, "Outer radius Up Down : %f", orad); break; case GEO_RAD: shapesPrintf ((*row)++, 1, "Radius Up Down : %f", orad); break; case GEO_BASE_HEIGHT: shapesPrintf ((*row)++, 1, "Base Left Right: %f", irad); shapesPrintf ((*row)++, 1, "Height Up Down : %f", orad); break; case GEO_RAD_HEIGHT: shapesPrintf ((*row)++, 1, "Radius Left Right: %f", irad); shapesPrintf ((*row)++, 1, "Height Up Down : %f", orad); break; } }
static void display(void) { int win = glutGetWindow(); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glColor3d(1,0,0); glDisable(GL_LIGHTING); glColor3d(0.1,0.1,0.4); if (win == mainwin) { shapesPrintf (2, 3, "Move The mouse into different windows"); shapesPrintf (3, 3, "pressing keys will add to the string"); } shapesPrintf (5, 3, "Window: %d", win); shapesPrintf (6, 3, "String: %s", strings[win]); glutSwapBuffers(); }
static void display(void) { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glm::mat4 m4Modelview = glm::lookAt( v3CameraPosition, v3CameraLookAt, v3CameraUp); glMatrixMode(GL_MODELVIEW); glLoadIdentity() ; glLoadMatrixf(glm::value_ptr(m4Modelview)); glEnable(GL_LIGHTING); if (s_pPoints) { } if (s_bDebug) { KDTreeDebugger::render(*s_pTree, s_nDebugTreeLevel, s_bRenderPoints); } glDisable(GL_LIGHTING); glColor3d(0.1,0.1,0.1); if( s_bShowInfo ) { shapesPrintf (1, 3, "KD-Tree depth: %u", s_pTree->getDepth()); shapesPrintf (2, 3, "Curent KD-Tree debug depth: %u", s_nDebugTreeLevel); shapesPrintf (3, 3, "Camera LookAt: (%f, %f, %f)", v3CameraLookAt.x, v3CameraLookAt.y, v3CameraLookAt.z); shapesPrintf (4, 3, "Camera Position: (%f, %f, %f)", v3CameraPosition.x, v3CameraPosition.y, v3CameraPosition.z); shapesPrintf (5, 3, "Camera Up: (%f, %f, %f)", v3CameraUp.x, v3CameraUp.y, v3CameraUp.z); } glutSwapBuffers(); }
static void drawInfo() { int row = 1; shapesPrintf (row++, 1, "Shape PgUp PgDn: %s", table [function_index].name); shapesPrintf (row++, 1, "Slices +-: %d Stacks <>: %d", slices, stacks); shapesPrintf (row++, 1, "nSides +-: %d nRings <>: %d", slices, stacks); shapesPrintf (row++, 1, "Depth (): %d", depth); DrawSizeInfo(&row); if (persProject) shapesPrintf (row++, 1, "Perspective projection (p)"); else shapesPrintf (row++, 1, "Orthographic projection (p)"); if (animateXRot) shapesPrintf (row++, 1, "2D rotation (r)"); else shapesPrintf (row++, 1, "1D rotation (r)"); }
static void display(void) { const double t = glutGet(GLUT_ELAPSED_TIME) / 1000.0; const double a = t*90.0; glMatrixMode(GL_PROJECTION); glLoadIdentity(); if (persProject) glFrustum(-ar, ar, -1.0, 1.0, 2.0, 100.0); else glOrtho(-ar*3, ar*3, -3.0, 3.0, 2.0, 100.0); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glEnable(GL_LIGHTING); glColor3d(1,0,0); glPushMatrix(); glTranslated(0,1.2,-6); glRotated(60,1,0,0); glRotated(a,0,0,1); table [function_index].solid (); glPopMatrix(); glPushMatrix(); glTranslated(0,-1.2,-6); glRotated(60,1,0,0); glRotated(a,0,0,1); table [function_index].wire (); glPopMatrix(); glDisable(GL_LIGHTING); glColor3d(0.1,0.1,0.4); if( show_info ) { shapesPrintf (1, 1, "Shape PgUp PgDn: %s", table [function_index].name); shapesPrintf (2, 1, "Slices +-: %d Stacks <>: %d", slices, stacks); shapesPrintf (3, 1, "nSides +-: %d nRings <>: %d", slices, stacks); shapesPrintf (4, 1, "Depth (): %d", depth); shapesPrintf (5, 1, "Outer radius Up Down : %f", orad); shapesPrintf (6, 1, "Inner radius Left Right: %f", irad); } else { printf ( "Shape %d slides %d stacks %d\n", function_index, slices, stacks ) ; } glutSwapBuffers(); }
static void display(void) { const double t = glutGet(GLUT_ELAPSED_TIME) / 1000.0; const double a = t*90.0; glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glEnable(GL_LIGHTING); glColor3d(1,0,0); glPushMatrix(); glTranslated(0,1.2,-6); glRotated(60,1,0,0); glRotated(a,0,0,1); table [function_index].solid (); glPopMatrix(); glPushMatrix(); glTranslated(0,-1.2,-6); glRotated(60,1,0,0); glRotated(a,0,0,1); table [function_index].wire (); glPopMatrix(); glDisable(GL_LIGHTING); glColor3d(0.1,0.1,0.4); if( show_info ) { shapesPrintf (1, 3, "Shape PgUp PgDn: %s", table [function_index].name); shapesPrintf (2, 3, "Slices +-: %d Stacks <>: %d", slices, stacks); shapesPrintf (3, 3, "nSides +-: %d nRings <>: %d", slices, stacks); shapesPrintf (4, 3, "Depth (): %d", depth); shapesPrintf (5, 3, "Outer radius Up Down : %f", orad); shapesPrintf (6, 3, "Inner radius Left Right: %f", irad); } else { printf ( "Shape %d slides %d stacks %d\n", function_index, slices, stacks ) ; } glutSwapBuffers(); }