5
Let the viewport should be the same as the whole window all the time.
Render a 3D 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 translate the whole scene
by click and drag the empty space
with right mouse button.
The whole scene should be translated
on the (virtual) plane which
(i) is parallel to the computer screen and
(ii) contains the center of the coordinate system.
(See viewer.c sample.)
20
Let the user rotate the whole scene
by click and drag the empty space
with left mouse button.
The axis of rotation should be
(i) orthogonal to the direction of
mouse movement and
(ii) contained in the (virtual) plane
which is parallel to the computer screen
and contains the center of the coordinate system.
(See viewer.c sample.)
25
Let the user can pick and drag any of
four control points
with right mouse button.
The control point should follow the mouse pointer
and be translated on the (virtual) plane
(i) parallel to the computer screen and
(ii) containing the center of the control
point when "picked."
(See viewer.c sample.)
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.)