Computer Science 112
The Art & Science of Computer Graphics

Fall 2015, The College of Saint Rose

Studio/Lab 8: Stained Glass Windows
Due: 11:59 PM, Friday, November 6, 2015

For this week's Studio/Lab exercise, you will be working with Bézier curves to construct a model of a stained glass window.

A Stained Glass Window

We saw in class that the message bezier() sent to a Prism object will instruct it to treat its profile as a set of control points for one or more Bézier curves, rather than as a straight-sided polygon. We will use this construct to build panes of glass, some with curved sides, that fit together to form a stained glass window.

I would like to collect all of our windows into a larger model, so please follow the guidelines below very carefully to facilitate this.

Typical Model Layout

Your model will likely be organized as follows. First, define your materials.

terescoRedGlass = Material()

Define panes of glass:

terescoPane3Profile = [ <point-list> ]
terescoPane3 = Prism()
terescoPane3.bezier() # interpret profile as collection of bezier curves
terescoPane3.scale(1, 1, 0.05) # ensure 5 units thick (normally, it's 100)
terescoPane3.material(terescoRedGlass) # assign a material

The panes will be added to a group that represents your entire window. At this point, also set a description for a title for your window.

terescoWindow = Group()
terescoWindow.add(terescoPane1, terescoYellowGlass)
terescoWindow.add(terescoPane2, terescoCyanGlass)
terescoWindow.add(terescoPane3, terescoMagentaGlass)
terescoWindow.description("Finestra Noiosa di Jim")

Example Model

The full example model from which the above excerpts were taken is available to you for use as a starter, or at least as a guide as you develop your window. You should have received an email with it as an attachment.

This is the window created by that file:


  1. Email a copy of the source code for your Ambrosia model (the Python file, which should always be saved with a .py extension) and your best image (which should always be saved in PNG format and using a .png extension) as attachments to terescoj AT Please include a meaningful subject line (something like "CSC 112 Studio/Lab 8 Submission"). Make sure your name is included in a comment in your model code, and that you have comments throughout the source code to make it easier to understand.
  2. Rename your best image to include your name, then upload it to the wiki. For example, if you generate an image of a window with smiley faces and your name is Guy Smiley, you might call your image "GuySmileyHappyWindow.png".
  3. Add a section to your wiki page named "Stained Glass Windows" that includes a link to your image and a description of your model that generated the image.


This assignment is worth 25 points, which are distributed as follows:

> FeatureValueScore
Glass materials 3
Window panes, including at least two with round sides 8
Composition of panes into a window 2
Appropriate test setting 2
Code organization and style 2
Model documentation and formatting 2
Image(s) on wiki page 2
Model description on wiki page 4
Total 25