/* MainControl.cpp Written by Matthew Fisher MainControl includes everything that changes often between applications, such as what meshes to load, and also determines what is rendered each frame. See the appropriate header file for a description of what this class does. */ //All source files include Main.h #include "Main.h" const int ShapeCount = 3; //the number of shapes in the shape ring const int CutCount = 4; //the number of possible cuts float CylinderRadius; //the radius of the cylinder's cut function float CylinderFunction(Vec3 &V) //a global function for splitting a mesh into two regions, one where this function is negative //(the inside of the cylinder) and another mesh that represents the region outside the cylinder. { return V.y * V.y + V.z * V.z - CylinderRadius * CylinderRadius; } float GridSize; //a paramater in the GridFunction function float GridFunction(Vec3 &V) //same purpose as CylinderFunction, except more complicated { return float((int(fabsf(V.x/GridSize)) + int(fabsf(V.y/GridSize)) + int(fabsf(V.z/GridSize))) % 2 - 1); } void MainControl::InitShapes(GraphicsDevice &GD) { ShapesUnCut.Allocate(ShapeCount); //allocate room for 3 meshes int i; for(i=0;i ", C.VecEye, 0, 20); //draw the camera position as text on the screen GD.DrawText("Use the + or - keys on the number pad to alter the cut type.", " ", 0, 40); //help GD.DrawNumber("Cut Type -> ", CutType, 0, 60); //draw the current cut type } void MainControl::FreeMemory() { }