
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

TFH, 1/21/
SCHOOL OF COMPUTER & INFORMATION SCIENCES CSC 413 Computer Graphics Assignment 1, due Monday, Feb 2
You are to simulate a binary raster (pixel array) by writing an OpenGL program, using GLUT, to display an array of ―logical pixels‖ (squares). The logical pixels have coordinates from – n to + n from left to right, and from – n to + n from bottom to top, with n having a value of 5. Each pixel has an indexed color (you can make an array of colors—you will only need two for this assignment). For the moment, colors can be 0 and 1, representing say, red and green. The client area should be 550×550.
You should use C++ with good object-oriented program design (even though OpenGL itself is not object- oriented).Your model could involve a class which simulates display memory (e.g., named FrameBuffer) containing a (2 n+ 1)×(2n+1) matrix (2D array) with elements representing the pixel color. You can also have a class (named, say Canvas) which is the visual display (and manipulation interface) of the FrameBuffer. This class should provide members to
The raster should randomly invert pixels, one at a time. This can be done on the idle event, whose call- back (event handler) is registered by the glutIdleFunc. Don’t forget to call glutPostRedisplay() to cause the client area to be repainted.
The behavior of the program should be as in the executable (dynamic specification) given on course web site. This first program is non-interactive. It will, in the next assignment, be extended to be interactive by being able to: