Computer Science 115 - Section 1 Fall 1998
A Scheme Graphics Project
The following is an exercise in graphics and Scheme.
The objective is to create a font collectively and to
write code to display the font in a scalable way.
Items with links point to actual assignments, whereas other bullets
list optional homeworks that could be assigned to augment the development,
but are not in the critical path of the project.
-
intro to line drawing
-
Write a procedure that draws a line from (x0, y0) to (x1,y1) in color r g b.
-
(scalable) box drawing
-
Write a procedure that draws a box with lower-left corner (llx lly)
upper-right corner (urx yur) in color r g b.
-
Write a procedure that draws a box with center (cx cy)
and horizontal edge size h and vertical edge size v
in color r g b.
-
pixel drawing
-
Write a procedure that draws a pixel at (x y) in color r g b.
-
Bresenham line using pixel drawing
-
Write a procedure that draws a line from (x0, y0) to (x1,y1) in color r g b.
using your pixel procedure and the Bresenham line algorithm.
-
Bezier curves using line drawing
-
Write a procedure that draws a curve from (x0, y0) to (x2,y2)
with intermediate control point (x1,y1) in color r g b.
Use your original line procedure to do this, not the Bresenham line.
-
draw a circle using Bezier curves
-
draw a circle in a square box that is scalable
-
Write a procedure that draws a square box with center (cx cy)
and edge size h having an inscribed circle, in color r g b.
-
Draw a letter of your choice or according to
some character assignments
- It must include both straight lines and Bezier curves and be scalable
-
Draw a letter
following some rules decided by the class
and draw new letter following these rules. Sample rules:
- In all cases, all curves are represented using lists of R2's
- Case 1: all curves are represented as triples whether curved or straight
- Case 2: straight lines are represented as triples whose third entry
is the symbol 'line
- Case 3: straight lines are represented as pairs and curves are represented as
triples
-
Decide as a group in class on a format for representing characters. Possibilities:
- A procedure (char 'x) returns the representation for the character
x
- A protocal is followed whereby the variable charx is the
representation for the character x
-
draw a tree (no labels)
-
draw a tree with labels
-
Spell your name
using the font developed by the class, and
draw all the characters
developed by the class.