Set the Language level to Intermediate Student and add the image.ss HtDP teachpack.
First, write a function
For example:
Next write the function combine-color-lists. It should consume two lists of colors of equal length and produce a list which is the pointwise (i.e., element-by-element) combination of the input colors.
Now write a function combine-images which consumes two images i1 and i2 of equal size and produces an image where all colors have been combined according to the meaning of combine above.
You can combine various images (e.g. rectangles, circles, triangles, text, etc.) using your combine-images function. Build several samples and include them in your submission.
[Note: Functions combine-colors, combine-color-lists and combine-images should be finished by the end of the lab session. To receive full credit, you should also get started on Part 2. Turn in all your work at the end of the lab session according to these submission instructions.]
[Note: To receive full credit, you should have a good start on Part 2. As usual, this part will also be part of this week's homework.]
Now consider rendering an image at an apparent depth. We will represent a depth as a number, and the higher that number, the "farther away" we will consider an image to be. An image at depth 0 will appear to be on the screen, depth 1 will appear to be slightly behind the surface of the screen, and so on.
In order to be presented as a pseudo-three-dimensional picture, your program must produce two similar images, one biased for the left eye, one biased for the right; those biased images will then be combined to create a three-dimensional presentation.
Write two functions render-left-eye and
render-right-eye to nudge a deep image in the appropriate
direction to assist in the desired illusion of depth. The
type of both functions is
Finally, write a function render which takes a number and an image and returns an image.
You can build various three-dimensional images out of rectangles, circles, triangles, text, etc. Build several samples and include them in your submission.
|
To receive full credit, you should complete Part 1 (functions combine-colors, combine-color-lists
and combine-images) and have made a good start on Part 2. This week's homework will include Part 2 of this lab.
Save all your files and submit all your work according to the submission instructions.
Material designed by Adam Shaw.