void DrawParthenon(MatrixStack modelMatrix) { //Draw base. using (PushStack pushstack = new PushStack(modelMatrix)) { modelMatrix.Scale(g_fParthenonWidth, g_fParthenonBaseHeight, g_fParthenonLength); modelMatrix.Translate(0.0f, 0.5f, 0.0f); GL.UseProgram(UniformColorTint.theProgram); Matrix4 mm = modelMatrix.Top(); GL.UniformMatrix4(UniformColorTint.modelToWorldMatrixUnif, false, ref mm); GL.Uniform4(UniformColorTint.baseColorUnif, 0.9f, 0.9f, 0.9f, 0.9f); g_pCubeTintMesh.Render(); GL.UseProgram(0); } //Draw top. using (PushStack pushstack = new PushStack(modelMatrix)) { modelMatrix.Translate(0.0f, g_fParthenonColumnHeight + g_fParthenonBaseHeight, 0.0f); modelMatrix.Scale(g_fParthenonWidth, g_fParthenonTopHeight, g_fParthenonLength); modelMatrix.Translate(0.0f, 0.5f, 0.0f); GL.UseProgram(UniformColorTint.theProgram); Matrix4 mm = modelMatrix.Top(); GL.UniformMatrix4(UniformColorTint.modelToWorldMatrixUnif, false, ref mm); GL.Uniform4(UniformColorTint.baseColorUnif, 0.9f, 0.9f, 0.9f, 0.9f); g_pCubeTintMesh.Render(); GL.UseProgram(0); } //Draw columns. float fFrontZVal = (g_fParthenonLength / 2.0f) - 1.0f; float fRightXVal = (g_fParthenonWidth / 2.0f) - 1.0f; for (int iColumnNum = 0; iColumnNum < (int)(g_fParthenonWidth / 2.0f); iColumnNum++) { using (PushStack pushstack = new PushStack(modelMatrix)) { modelMatrix.Translate((2.0f * iColumnNum) - (g_fParthenonWidth / 2.0f) + 1.0f, g_fParthenonBaseHeight, fFrontZVal); DrawColumn(modelMatrix, g_fParthenonColumnHeight); } using (PushStack pushstack = new PushStack(modelMatrix)) { modelMatrix.Translate((2.0f * iColumnNum) - (g_fParthenonWidth / 2.0f) + 1.0f, g_fParthenonBaseHeight, -fFrontZVal); DrawColumn(modelMatrix, g_fParthenonColumnHeight); } } //Don't draw the first or last columns, since they've been drawn already. for (int iColumnNum = 1; iColumnNum < (int)((g_fParthenonLength - 2.0f) / 2.0f); iColumnNum++) { using (PushStack pushstack = new PushStack(modelMatrix)) { modelMatrix.Translate(fRightXVal, g_fParthenonBaseHeight, (2.0f * iColumnNum) - (g_fParthenonLength / 2.0f) + 1.0f); DrawColumn(modelMatrix, g_fParthenonColumnHeight); } using (PushStack pushstack = new PushStack(modelMatrix)) { modelMatrix.Translate(-fRightXVal, g_fParthenonBaseHeight, (2.0f * iColumnNum) - (g_fParthenonLength / 2.0f) + 1.0f); DrawColumn(modelMatrix, g_fParthenonColumnHeight); } } //Draw interior. using (PushStack pushstack = new PushStack(modelMatrix)) { modelMatrix.Translate(0.0f, 1.0f, 0.0f); modelMatrix.Scale(g_fParthenonWidth - 6.0f, g_fParthenonColumnHeight, g_fParthenonLength - 6.0f); modelMatrix.Translate(0.0f, 0.5f, 0.0f); GL.UseProgram(ObjectColor.theProgram); Matrix4 mm = modelMatrix.Top(); GL.UniformMatrix4(ObjectColor.modelToWorldMatrixUnif, false, ref mm); g_pCubeColorMesh.Render(); GL.UseProgram(0); } //Draw headpiece. using (PushStack pushstack = new PushStack(modelMatrix)) { modelMatrix.Translate( 0.0f, g_fParthenonColumnHeight + g_fParthenonBaseHeight + (g_fParthenonTopHeight / 2.0f), g_fParthenonLength / 2.0f); modelMatrix.RotateX(-135.0f); modelMatrix.RotateY(45.0f); GL.UseProgram(ObjectColor.theProgram); Matrix4 mm = modelMatrix.Top(); GL.UniformMatrix4(ObjectColor.modelToWorldMatrixUnif, false, ref mm); g_pCubeColorMesh.Render(); GL.UseProgram(0); } }