The next set of programming assignments (11 and 13 – there is no 12) are linked together to make one bigger assignment. Assignment 11 will have you do the basics, and figure out the infrastructure. Then assignment 13 will have you add more advanced features.

This project is a variant of the train project from previous 559. The train was a project in the first 559 (in 1999), and has been a favorite since. If you want to see some history, check out last year’s project (2014 train) that has links to previous assignments (including 1999). Be aware: this years assignment is quite different.

This year, we’re going to only do trains in 2D. You’ll use a 2D top down view of the track. This is a big simplification – it keeps the main pedagogical goals (teaching you about curves), but avoids having to do all the 3D stuff. A big reason for this is providing infrastructure, and a UI – modern GL (which WebGL is a variant) makes it harder to implement 3D user interfaces. You can make things in 3D if you want, but it isn’t the emphasis of this assignment.

The goal of this project is to give you a chance to try out making curves (for the train tracks), and then trying out some of the more advanced stuff about curves (like arc-length parameterization, using the tangent vectors to get orientation, …)

We will provide you with some basic framework code that gives a user interface. The code makes a canvas, and stores a collection of points. It lets you move the points around (so you can reshape the track), add points (use shift-click) and delete points (backspace key). It has a time slider that allows you to scrub through time, or let the thing run – with a speed control. You don’t have to use the framework code, but it will save you time. If you write your own, you’ll need to add, delete, and move control points, as well as have a scrub-slider and a run button.

The framework code is set up to work with both WebGL and HTML5 2D Canvas. We recommend using the latter. It’s a lot simpler, and you can make things that look nice in 2D with it (which is the goal). Look at the framework code to see how much grungier the WebGL code is. If you want to do fancy visual effects with shaders, then use WebGL.

The Train Track

The main thing to make is a train track. It should use the control points (that the user can drag around). It’s best if the track updates as the user drags (and adds/deletes) points, but if your program is too slow, you can make a button for updating things.

Your program can support multiple kinds of curves for the track. One of the track types should be C(1) continuous. We recommend Catmull-Rom (cardinal) splines. However, we also recommend you start with something even easier (line segments connecting the points) – it will look silly since the train will snap its direction between segments, but at least you can get it working. A simple track is better than no track at all.

To start with, it’s OK to draw the train track as a thin line. Later you can add nicer, advanced drawing (parallel rails, rail ties, …)

The track should always be a loop. Unless you intentionally make some more complicated track with switches – in which case you’ll also need a UI for keeping the train driving along the track (that would be an advanced bonus feature).

The Train

You can draw something nice for the top view of the train. Start with something simple (make a box that goes around the track) and then add to it to make it nicer. It’s better to have a simple train that goes around the track correctly than a fancy train that does not.

Your train should have a front, so it’s clear that it is going the right way around the track. Getting the train to face the right direction is an important feature (but is beyond the basics)

The Framework Code

You can download the framework code from here (github). You can try running the test program (not really a train) here (and the WebGL version). In the directory is part of my example solution – but it won’t run since I didn’t give you the actual code for the train or curves. It is meant as an example to look at to help you understand how to wire the pieces together.

The main things you need in the code:

  • There is a DotWindow – a constructor that adds the UI for points onto a canvas.
  • The DotWindow makes callbacks to draw objects besides the dots (add a function to the “userDraw” list). It also calls a function whenever the list changes (use this to rest caches if you are caching values)
  • There is a file called “trainTime.js” that makes the slider/timeline controller. It’s main thing is that it calls all the callbacks on the “onchange” list whenever the time changes. If the number of points in your spline changes, you need to update the “max” value of the slider (unless you renormalize somewhere). You can look in trainCurveTest (look on the “onChange” function added to the dotWindow).

Again, look at trainCurveTest.js – it won’t work (since I didn’t give you the file that defines CurveCache – but it can give you some ideas as to how the UI gets attached. The Bezier and BSpline demos (written to show those concepts in class) may be useful as well.

The Assignments

For Program 11 (due November 19th) – you need to make a basic train. There needs to be a train and a track, and the train needs to go around the track. For this, a square for the train, a line for the track is OK. The main thing with this assignment is to get the hang of working with the framework code. You should have a C(1) curve. You can have more, since you’ll need to do it for the next assignment.

There is no assignment 12 (because November 26th is Thanksgiving). So you get 2 more weeks to do assignment 13.

For Program 13 (due Dec 3rd) – you will have a nice train project. Each of the following features is worth something – but you can think of others as well. The following parts relate to the curves and are worth more in terms of grading:

  • Have the train point the right direction as it goes around the track
  • Have arc-length parameterization (so the train goes a constant speed) – this is essential for many other features (like rail ties and multiple cars)
  • Have multiple train cars (that follow at the right distance behind the train) – this requires arc length parameterization to keep things together.
  • Have rail ties (the bars that go across the rails) – again, arc length parameterization is important to get the spacing right
  • Support C(1) (cardinal splines) and C(2) (cubic B-Spline) curves
  • Have parallel rails
  • Have tension controls for the cardinal splines
  • Have “trucked wheels” – Real trains have wheels at the front and back that are both on the track and that swivel relative to the train itself. If you make real train wheels, you’ll need arc-length parameterization to keep the front and rear wheels the right distances apart (make sure to draw them so we can see them swiveling when the train goes around a tight turn).

There are of course lots of other things to add…

  • Make a nicer looking train (just because it’s from the top doesn’t mean it has to be simple)
  • Make the tracks look nice
  • Make scenery – the background doesn’t have to just be white
  • Make smoke – have the train leave a trail of smoke that dissipates
  • have train crossings – with gates that go down when the train goes by
  • have multiple trains – and have them slow down to avoid crashing into each other

Of course, if you want to add a 3D view, you can.

You can look at last year’s assignment for more ideas. A lot of them don’t make sense in 2D.

Evaluation

For program 11, we will grade check/no-check. You will get a check if you turn in something that has a train that goes around a C(1) track.

For program 13, we will give you a letter grade. It’s hard to predict the scoring system – but having correct direction and arc-length parameterization is probably worth a B – to get a better grade, you’ll need to add more stuff.

For both programs… You will turn in the program into your handin directory. There are separate handin directories for P11 and P13. For P11, there will be no Canvas handin required. For P13, there is a canvas link. You just need to describe what features your program has (turn it in to your handin directory).

Note: you need to turn in Program 11. Yes, Program 13 subsumes it – but it would be very late for Program 11. We really want you to do Program 11 on time so we know that you’ve started the assignment. Don’t save P13 for the last minute.

TA Office Hours on Wednesday postponed to Friday

by jmishra on November 8, 2015

I am postponing my office hours on this Wednesday (11/11) to Friday (11/13) (4 – 5:30pm). Office hours tomorrow (Monday 11/9) will remain unchanged.

The week in 559: Week 10 (Nov 9-13)

by Mike Gleicher on November 6, 2015

This past week, we started to talk about curves and shape, and you learned about Virtual Reality. You also implemented some advanced texturing in Graphics Town.

This week, you’ll wrap up graphics town with program 10, and we’ll learn more about curves and surfaces.

  • Monday (11/9) – Reading 10 is due. There is no quiz this week – next week’s quiz will be about curves.
  • Tuesday (11/10) – Lecture on Curves. We’ll actually make some curves.
  • Thursday (11/12) – Lecture on Curves and Surfaces. Stuff you’ll want for the next project.
  • Thursday (11/12, 11:59pm) – Programming Assignment 10 Due. The culmination of Graphics Town!

The following week we’ll talk more about surfaces and meshes, and start the next project – the train!

And please make sure you’ve returned you exam. We’re going to try to provide some grading feedback.

P9 Handins

by Mike Gleicher on November 5, 2015

Someone noticed that P9 handins were broken on Canvas. I think we have it fixed now. We have extended the deadline until tomorrow.

Return you exams tomorrow

by jmishra on November 4, 2015

It is mandatory for you to return the exams you picked up yesterday in class. You must do that tomorrow. I will collect them from you just before class begins tomorrow at 11:00am. Please keep them handy.

Your programming assignment submissions for 5, 6 and 7 have been graded. Students who read directions carefully in the assignment posts have received grades. Many students did not receive any grade because they did not do one or more of the following:

  1. For assignment 5, they did not post a link to their shaders in canvas. It is not possible for me to manually copy your shader text submissions and paste them at something like shdr.bkcore.com. Please post your links in the comments section in canvas. Try to use a URL shortening service, if possible.
  2. For assignment 6, a few submissions did not render anything. Out of them, a few just rendered a box with sliders and nothing inside the box. Please test your submission and resubmit.
  3. For assignment 7, many of you did not post a link to your submission in canvas. Do that as soon as possible. Also I will not be able to grade submissions from github, box and other proprietary sources. You must use the new handin mechanism. Your link must look something like https://pages.cs.wisc.edu/~cs559-1/handin2015/p7…

I will do another scan of your submissions over the weekend. Make sure you take care of the above as soon as possible, preferably within the next two days. This won’t take more than 5 minutes of your time, but will give you those precious grade enhancing points.

Reading 10: Curves

by Mike Gleicher on November 3, 2015

Due: Monday, November 9th

Evaluation: There will be no quiz this week. We’ll have a quiz on this material after we’ve discussed it in lecture. This can be tricky stuff, and will appear a lot in upcoming programming assignments, homework assignments, and exam questions.

Required Reading

Chapter 15 of Foundations of Computer Graphics: is a thorough introduction to curves. It’s a little too focused on the derivations (which is the way that I used to teach it), but makes clear things like continuity conditions and piecewise representations. So read 15, 15.1 and 15.2. Look through 15.3 and 15.4 (since it will help you understand later stuff), and 15.5 (Cardinal cubics are really important – and will be the basis of an upcoming assignment). And 15.6.1 on Beziers is important. Don’t worry about B-Splines (15.6.2) – they are really important, but we won’t have time to cover them now.

Supplemental Readings:

The following two resources provide different views of the same material, and might be helpful in understanding it.

Chapter 13 of Real Time Rendering: Section 13.1 contains a good introduction to parametric curves, especially Beziers. Don’t worry about Rational Beziers, drawing filled regions (13.1.1). 13.1.5 is something we won’t really cover in class, but is really useful in practice.

Chapter 20 of Hart’s Big Fun Graphics Book: is a nice treatment of the same topics. Again, stop when you get to B-Splines.

Midterm Grades

by Mike Gleicher on November 3, 2015

The midterm has been graded!

Most people did well – the mean was just over 80, and the median was just above 83.

We are not providing an exact mapping to letter grades: we are not going to pick specific cutoffs. Roughly, above 90 for an A, in the 80s for an AB, 70s for a C, but if you’re a point or two either way, it could be pushed for you. (if you did well on the assignments and homeworks, we’re more likely to push you higher, etc). Final grading will be done by looking at the complete picture of your grades.

That said, if you scored below 70 on the exam you probably should be concerned about your level of mastery of the material.

An answer key is posted here. midterm-key-cs559-f15

We will allow you to get your exam after class on Tuesday. However, we require you to return your exam before class on Thursday (we need to keep them). If you find a grading error, send an email to the course staff address. Note: if you ask for you exam to be re-graded, we will check the entire exam.

The Week in 559: Week 9 (Nov 2-6)

by Mike Gleicher on November 1, 2015

Last week you took the midterm, implemented texturing in Graphics Town, and learned about advanced texturing.

This week, we’ll start talking about shape, and have a guest lecture on Virtual Reality. And we’ll try to implement some of that advanced texturing.

  • For Monday, November 2 – there is no homework assignment! There is a reading, but half of it was already assigned, and the other half is a preview of the following week.
  • On Tuesday, November 3 – we’ll have a lecture on the basics of representing shapes in graphics, and maybe some more commentary on advanced texturing and interactive rendering tricks. You’ll get your exams back in class.
  • On Thursday, November 5 – we’ll have a guest lecture on Virtual Reality by Prof. Kevin Ponto. And if you took your exam, you’ll need to bring it back.
  • On Thursday, November 6 – Programming Assignment 9 is due. Keep adding cool stuff to graphics town!

The following week, we’ll wrap up the graphics town project and learn about curves.

Programming Assignment 10: Graphics Town

by Mike Gleicher on October 31, 2015

Due: Thursday, November 12 (see the class late policy on the Syllabus)

Synopsis: Over the past few weeks you’ve added a lot of stuff to your graphics town project. This time, we just want you to add more coolness.

Learning Objectives: Have a chance to put together all the concepts over the past few weeks in order to make something more substantial.

Handin: You will use the course handin system (put this in your P10 handin directory, and add a writeup in Canvas). Note: even though you’ve turned in previous versions of your programs, you must turn in a complete working program again this time.

Description

Over the past few weeks, you’ve worked on Graphics Town. Each week we’ve asked you to add a specific thing – based on the technology we were learning. You made moving shapes, you added textures, you added fancier textures. Now we aren’t going to be specific about what to add: we just want you to turn your project into something that you think is an interesting world to show off, a coherent whole instead of something showing off specific things you learned.

Over the past few weeks, you’ve checked off the check boxes (shapes, shaders, lighting, textures, …). This time, the evaluation is more holistic: have you created enough complexity, interestingness, made good use of those technical things you learned, made some good artistic choices, …. Yes, this is hazy and fuzzy and subjective.

We will consider the following in evaluation:

  1. How well do you implement the specific techniques (shapes, shaders, lighting, texture, advanced texturing) beyond the minimums?
  2. How much complexity and richness is in your world?
  3. How well do you use the techniques for effective purposes? (did you make interesting stuff out of the techniques)
  4. How cool and creative is your world? Is there a theme?
  5. How hard technically was what you did?

Note: doing well in the overall project doesn’t necessarily mean you did well in all the component parts leading up to this. If you didn’t hand in P8 with a texture, having a really complicated world won’t make up for it. However, within P10, the different aspects can be traded off: if it’s really creative, but technically simple, we are OK. If it’s really technically amazing, but there is no theme, that can be OK.

Coming Attractions…

Starting next week, we’ll move on to the next project.