Workbook 11: The Train Workbook

CS559 Spring 2023 Sample Solution

This is a sample solution for the Workbook. You are welcome to refer to it to learn one way to do the assignment but only after you have turned in your own assignment

Learning Goals

  1. To practice some key computations with curves.
  2. To implement various aspects of curves in the context of an application.
  3. To appreciate why curve concepts, such as arc length parameterization and smoothness, are useful.
  4. To write an interesting graphics program.

This project continues our study of curves in 2D. Last week’s workbook went through the key ideas. This week, we’ll put those ideas into action in a programming assignment: making a train that goes around a track.

Required Reading

There is no new required reading for this week. The readings on curves were part of Workbook 5. You may want to review these readings (including the workbook itself). If you haven’t read them, now is a good time to do so. Doing the train will require you to understand the key concepts of curves. Some curve topics are less important for the train, but will come back on exams, or, if you ever do something in computer graphics beyond class.

Textbook: Curves are covered in FCG4 Chapter 15. We won’t cover all the material in class. The sections are:

  1. FCG 15.1 - basic ideas of curves, including parameterizations and piecewise representations
  2. FCG 15.2 - curve properties (especially continuity)
  3. FCG 15.3 - polynomial pieces - you need to have the basic intuitions but you will not need to do the derivations yourself
  4. FCG 15.4 - putting pieces together - this makes things sound more complicated than they are
  5. FCG 15.5 - cubics - you’ll need cardinals for the train
  6. FCG 15.6.1 - Bézier curves - very important, since they are what gets used in Canvas and many other things
  7. FCG 15.6.2 - B-Spline curves - (and 15.6.3 and 15.6.4 which are advanced kinds of B-Spline curves) is optional

Rubrics for Grading

Workbook Rubric (113 points total)
Points (82):
20 pt
correct P1 Canvas Assignment submission
20 pt
clear explanations in p1-workbook.txt
20 pt
correct P1G Canvas Assignment submission on time
Box tr-01-01
4 pt
Drawing the track as a single simple curve (cardinal spline) that interpolates the control points
Box tr-01-01
5 pt
Train goes around the track correctly ('evenly in parameter space' - continuous looping motion)
Box tr-01-01
2 pt
The interface still works (the track can be moved and the run slider works, even while the train is in motion)
Box tr-01-01
2 pt
Train has a front
Box tr-01-01
3 pt
Train points in the right direction as it goes around the track
Box tr-01-01
3 pt
Train direction and motion is correct even as points are added/removed
Box tr-01-01
3 pt
Default track configuration shows off arc length (train should speed up and slow down if arc length parameterization is turned off or not implemented)
Advanced points (31):
Box tr-01-01
3 pt
Arc Length parameterization (train goes at a relatively constant speed as it goes around the track, no matter what the control point spacing is). You must add a checkbox to turn this on and off. This one is hard, but it enables several of the other things, so it is actually worth a lot
Box tr-01-01
2 pt
Rail Ties drawn perpendicular to track
Box tr-01-01
2 pt
Rail Ties drawn with correct spacing (this is simple once you have arc-length
Box tr-01-01
3 pt
Parallel rails
Box tr-01-01
3 pt
Multiple cars all of them centered on the track
Box tr-01-01
3 pt
Multiple cars that are fixed distance apart)
Box tr-01-01
3 pt
Trucked wheels (requires keeping the pairs of wheels the correct distance apart and on the track, and having the train car positioned appropriately - this is only for people who are into trains and appreciate this detail)
Box tr-01-01
2 pt
Slider to control tension
Box tr-01-01
4 pt
Switchable B-Splines
Box tr-01-01
2 pt
Smoke
Box tr-01-01
2 pt
Scenery
Box tr-01-01
2 pt
Scenery adapts to the track

Get Started

Don’t forget to commit and push as you work!

Get started on Page  1  (The Train: Intro)!