static GLboolean persProject = GL_TRUE;
static GLboolean animateXRot = GL_FALSE;
static GLboolean useShader = GL_FALSE;
+static GLboolean visNormals = GL_FALSE;
/*
* These one-liners draw particular objects, fetching appropriate
ENTRY (Sphere),
ENTRY (Cone),
ENTRY (Cylinder),
- ENTRY (Cuboctahedron)
+ ENTRY (Cuboctahedron) /* This one doesn't work when in shader mode and is then skipped */
};
#undef ENTRY
else
{
/* fixed function pipeline */
+ glutSetOption(GLUT_OBJECTS_VISUALIZE_NORMALS,visNormals); /* Normals visualized or not? */
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
if (persProject)
shapesPrintf (9, 1, "2D rotation (r)");
else
shapesPrintf (9, 1, "1D rotation (r)");
+ if (!useShader)
+ shapesPrintf (10, 1, "visualizing normals: %i (n)",visNormals);
} else {
/* print to command line instead */
printf ( "Shape %d slides %d stacks %d\n", function_index, slices, stacks ) ;
case 'S':
case 's': useShader=!useShader; break;
+ case 'N':
+ case 'n': visNormals=!visNormals; break;
+
default:
break;
}