Homework 2 due 10/17/02
This assignment has both a written portion and a programming portion. As a reminder, you are expected to perform all work on your own. Examining others’ solutions or code is not allowed.
Written portion:
1. [8 points] Assume you are given a rational Bezier curve with control points b0, b1, b2, b3, and weights w0=w1=w2=w3=1.
a) [4 points] Assume that w1 is changed to 0. How is the curve affected? Can the curve be replaced by one of lower degree?
b) [4 points] Assume instead that w3 is changed to –1. How does the curve behave as you move from b0 to b3?
2. [6 points] Assume you are given a quadratic Bezier curve that interpolates endpoints a at t=0 and b at t=1. Describe what you would need to do to the curve to make the following changes:
a) [1 point] Change the position of b but not the position of a.
b) [2 points] Change the position of b, but not the position or first derivative at a.
c) [3 points] Change the position of b, but not the position, first, or second derivative at a.
3. [6 points] Consider a Bezier curve with n control points. Assume that the first j<n control points are identical.
a) [2 points] What effect (if any) do the identical control points have on the curve?
b) [4 points] Assume you subdivide the curve at the parameter value 0<c<1. What can you say about the control points for the curve over [0,c]? What about for the control points for the curve over [c,1]?
Programming portion:
[80 points] Create a program that will read in, manipulate, and display a NURBS curve. Skeleton code will be provided on the website in the next few days to let you draw points and lines, though you are encouraged to write your own display routine if you feel comfortable doing so. Your code should do the following:
1) Read in a knot vector and set of control points for the curve from a file. The specific format and an example file or two will be posted on the website in the next few days.
2) Evaluate the curve at several parameter values. Then display the curve by drawing all of the points you find on the curve and connecting them with line segments (the more points you evaluate, and the closer together they are, the more it looks like a curve).
3) Break up the curve into a sequence of Bezier curves. You should allow the user to step through the Bezier curves and display one curve at a time. Display both the Bezier control polygon and the curve itself. To display the control polygon, just draw lines between the control points for that Bezier curve. To display the curve itself, evaluate the curve at several points and connect those points by line segments (again, the more points you use, the more it will appear like a line.
Your code does not have to display both 2) and 3) at one time.