10
Always show the area (-1.5,-1.5)×(1.5,1.5)
in the window regardless of the window size.
The marginal area must be rendered, too.
(i.e., the viewport should be the same as the whole window all the time.)
Render a cubic Bézier curve in three different ways.
10
Evaluates points on the curve using
OpenGL glMap and glEvalCoord
and approximate the curve with a piecewise linear curve.
(Render the evaluation points and line segments in white color.)
50
Evaluates points on the curve using
the de Casteljau's algorithm
and approximate the curve with a piecewise linear curve.
(Render the evaluation points and line segments in cyan color.)
80
Subdivide the control points (control polygon)
up to certain depth (0 for no subdivision)
and render eacah of the subdivided
control polygons to approximate the curve.
(Render the subdivided control polygons
in
yellow
and
violet
colors
alternatively. See the screenshot below.)
Implement user interface.
20
Let the user can pick and drag any of
four control points.
You can adopt whatever picking method you want.
10
The control polygon and the curve
should change accordingly
dynamically while moving any control point.
10
Keyboard interface:
The number of evaluation points
can be increased/decreased by UP/DOWN arrow keys.
The subdivision depth can be increased/decreased
by PageUp/PageDown keys.
Three rendering modes can be switched
circularly by TAB key.
Display detailed info.
5
Display current position of each control point
beside.
The position info should change dynamically
when moving the control points.
10
Display detailed info on the bottom-left corner
of the screen
(number of evaluated points,
current subdivision depth,
current rendering (evaluation) method, etc.)