CS 184: COMPUTER GRAPHICS

Heads-up!!  -- Midterm-Exam: in class on Wednesday 3/16 -- be prepared; show up on time!

How to prepare for the Midterm-Exam


PREVIOUS < - - - - > CS 184 HOME < - - - - > CURRENT < - - - - > NEXT
A)  For the cubic Bézier segment given by control points (P,Q,R,S) find the point at t=0.666 and its tangent direction using the deCasteljau method. B)  Approximate this curve with C1 continuity using  four  cubic Bézier segments. C)  Create a G1-continuous, fair, interpolating spline through all the numbered data points (1. . .7), composed of six cubic Bézier segments.
deCasteljau
data points
Solution for A)                                                                                 Solutions for B) and C)

Lecture #14 -- Wed 3/9/2011.

finishing up from last lecture ...

Properties of Cubic B-Splines

  • Piecewise cubic polynomial;
  • Does NOT interpolate control points;
  • Convex hull property;
  •  Variation diminishing;
  •  Construction by 3-fold linear interpolation;  (different from the one for Bezier curves)
  • Invariant under affine transformations;
  • Start-to-end symmetry;
  • Twice differentiable (C2) at joints;  (infinitely in between)
  • Infinitely differentiable everywhere else;
  • May have cusps, thus may not even be G1, everywhere;
  • Good to make smooth closed loops   ==> Try to put a knot into your roller-coaster track!

  • DISCLAIMER:  This is a very minimal introduction to cubic splines;
    just enough to actually use them in As#7 and As#8.
    [ More on splines in CS 284 and CS 283, CS 285 
    (These courses can be taken in any order). ]


    The next assignment involves modeling a rollercoaster track and moving a car (and a camera) along it. 
    Thus we need to learn about space curves!

    Differential Geometry of 3D Space Curves

    Analysis of Curves (as compared to "Design" or "Data Fitting")

    Construction of the Frenet Frame (Reference frame for intrinsic properties)

    Serret - Frenet Relations

    Sweeps along Polylines (and piecewise linearly approximated curves)

    Examples of mitered joints (by Koos Verhoeff): 1 2 3 4    (by CHS): 5   Note: the individual segments look completely free of twist!
    However, overall there may be some built-in torsion; and if you slide once around the whole curve, always staying in the same "face,"
    you may end up on a different facet than the one that you started in!

    Default construction:  Keep a cross-section of constant geometry and always positioned perpendicular to the tangent vector.
    This can be achieved by constructing "ribs" in the angle-divider plane at all segment junctions,
    and stretching them by 1/cos(half-angle) in the direction of the normal vector.  Now, we still have to fix the azimuth angle.
    A "natural" orientation of the cross section would be based on the Frenet frame (x-axis pointing in curve-normal direction),
    but it would lead to serious torsional twisting around inflection points.
    A better orientation of the cross section can be chosen so as to minimize torsion; (also called rotation-minimizing frames = RMFs):
    The vertices of the cross-sectional polygon are projected forward from one angle-divider plane to the next, parallel to the tangent vector.

    For our rollercoaster example, the default orientation of the (track) cross section is most conveniently chosen so as to always point "up" as much as possible.  We start with an RMF track, but add the minimal amount of twist to make ic close smoothly on itself.  Then we fix the global azimuth to keep the profile "level" in some horizontal, slow-moving, straight section of track.  From there we add
    additional corrective azimuth values at those control points where it seems necessary (e.g., to keep the track level at other straight track segments, or to bank the track into sharp curves). These additional azimuth values will be interpolated with the same cubic polynomial as the  B-spline coordinates.

    Once the cross-sectional ribs have been constructed at all the joints, corresponding vertices of subsequent ribs are connected,
    and the B-rep of a (possibly twisted) track is constructed by constructing prism faces between pairs of subsequent ribs.
    All these faces together will form a "water-tight" B-rep of a generalized sweep, in particular, a toridal structure of genus 1 (ONE loop). 
    Example of a triply twisted Moebius band forming a trefoil knot
    -- and a more finely segmented version with the control polygon shown.
    -- and finally a smooth version with the twist properly adjusted to close that small mismatch.

    In Assignment#8  you will make worms/snakes/ribbons/sculptures with the same principle,
    but with much fancier surfaces with texture-mapping and bump-mapping.


    Ideas for extra credit on Rollercoaster Assignment

    1.)  Tie track layout to the polygon editor of As#2

    Rather than typing in coordinate triplets for the control points, modify the polygon editor of As#2 to modify the control vertex positions until you have a rollercoaster that you like. Perhaps you display two parallel projections of the control polygon for the track as follows:
    -- first a top down view that shows the basic layout in which you move vertices only with respect to their (x,y) values;
    -- then a side view in which you can adjust the height of the various control points.
    [ Such an editor may come in particularly handy in the next assignment when you try to make amuch fancier knotted "worm." ]

    2.)  Put some texture on the rollercoaster track

    To make the track more interesting to move along, and to get a better sense of the momentary speed of the car, it would be nice to have some tick marks along the track. A natural way to provide such tick marks are the ties that carry the rails of the track. A simple way to provide suchdecoration on top of the track is by texture mapping, in which a desired pattern (texture map of track) is placed repeatedly along the track surface, suitably registered with texture coordinates s and t. The texture map then serves as a look-up table, and for each pixel the texture coordinates (s,t) are interpolated bilinearly.   (More on texture mapping in the next assignment).

    Complicated Interpolating Splines made from Bezier Segments

    How to put two Bezier segments together with G1 or with C1 continuity.

    How to generate a G1-continuous compound Bezier curve through many interpolation points.

    How to do this with G2-continuity ...  (take CS 284).


    Reading Assignments:

    Read about cubic curves, texture mapping;  compare to lecture notes and assignment write-ups.
    Shirley: [ 2nd Ed: Ch 15;  11.2-11.7
    Shirley: { 3rd Ed: Ch 15 11.2-11.6 }



    Programming Assignment #7: May be done in pairs; due (electronically submitted) before Saturday 3/12, 11:00pm.

    Programming Assignment #8: May be done in pairs; due (electronically submitted) before Monday 3/28, 11:00pm == after Spring Break!


    PREVIOUS < - - - - > CS 184 HOME < - - - - > CURRENT < - - - - > NEXT
    Page Editor: Carlo H. Séquin