Commits

Jason McKesson  committed d4d0025

Added scaling to the fragment lighting tutorial.

  • Participants
  • Parent commits f15d441

Comments (0)

Files changed (1)

File Tut 09 Plane Lights/Fragment Directional Lighting.cpp

 static bool g_bUseFragmentLighting = true;
 static bool g_bDrawColoredCyl = false;
 static bool g_bDrawLight = false;
+static bool g_bScaleCyl = false;
 
 //Called to update the display.
 //You should call glutSwapBuffers after all of your rendering to display what you rendered.
 				modelMatrix.RotateY(g_CylYaw);
 				modelMatrix.RotateZ(g_CylRoll);
 
+				if(g_bScaleCyl)
+					modelMatrix.Scale(1.0f, 1.0f, 0.2f);
+
 				if(g_bDrawColoredCyl)
 				{
 					glUseProgram(pVertColorProgram->theProgram);
 	case 'J': g_fLightRadius -= 0.05f; break;
 
 	case 'y': g_bDrawLight = !g_bDrawLight; break;
+	case 't': g_bScaleCyl = !g_bScaleCyl; break;
 	}
 
 	if(g_fLightRadius < 0.2f)