Homework # 3: Parametric Surface (Due Date:Thursday 21/4/2016 by Midnight)

Submit your homework via E-learning

Compress the code files (surface.cpp, Matrix.h, and Matrix.cpp) to one file named StudentID_FirstName.zip

Implement two of the parametric surfaces methods that we studied in class (Interpolating, Bezier, and B-Spline).

Code skeleton is here: Curve.cpp   Matrix.h   Matrix.cpp

You code should read control points from a input file.
		std::vector<std::vector<Matrix>> vecSurfCtrlPoints;
		void init ()
			// read surafce control points
			ifstream in;
			in.open ("Surface10x10.txt", ios::in);
			int numUs, numVs;

			for (int i = 0; i < numUs; ++i)
				std::vector vecPoints;
				for (int j = 0; j < numVs; ++j)
					Matrix point (3, 1);
					vecPoints.push_back (point);
				vecSurfCtrlPoints.push_back (vecPoints);

			glClearColor (1.0, 1.0, 1.0, 0.0);	// set display-window color to white
			glEnable (GL_DEPTH_TEST);

Assign different (or random) colors to patches

Surface Input files
surface10x10.txt   Surface of 100 control points (7 patches). 10 rows (u's) of 10 columns (v's)

surface4x10.txt   Surface of 40 control points (3 patches). 4 rows (u's) of 10 columns (v's)