600.357/600.457 Assignment 3

Handed out: Oct 31
Due: Nov 19, 4:00pm. -- EXTENDED TO NOV 21, 4pm

457 students, turn in your assignment here
357 students, turn in your assignment here

As usual, a Makefile/project file, documented source and a README file must be included.

Note: 20% of your grade will be depend on the design, readability and documentation of your program.


We will push regular OpenGL further away. Implement clipping and rasterization outside of OpenGL. Use a Z-buffer to determine visibility. You will now produce the final image and simply send your image to the window. One way to do this is via OpenGL's glDrawPixels Call. Implement:

In addition implement default transparency. Assume GL_BLEND is always enabled and glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) is set. Color now has four components and all four must be computed -- use the fourth component, alpha, to encode transparency.

Note that we do not need gllSetMatrix any more.


457 students are required to implement anti-aliasing. Add an extra function:
gllAntiAliasMode(float baseSize, int filter[], int filterSize)
The function takes the size, in pixel-units, of the filter, i.e., the filter footprint. It also expects that actual filter table which will be used for filtering (weighted averaging) the image. In other words, The image will have to be super-sampled (in both X and Y dimensions) by filterSize/baseSize.

For your testing pleasure, some functions are shown below (these work well with a supersampling of 4x4 (i.e, baseSize = 2).

Box Filter Bartlett Filter Gaussian Filter
1 1 1 1 1 1 1
1 1 1 1 1 1 1
1 1 1 1 1 1 1
1 1 1 1 1 1 1
1 1 1 1 1 1 1
1 1 1 1 1 1 1
1 1 1 1 1 1 1
1234321
2468642
36912963
4812161284
36912963
2468642
1234321
14810841
412252925124
825495849258
1095867582910
825495849258
412252925124
14810841

To test the effectiveness of your algorithm, you can increase the window size (or save the image in a file and increase the window size in a thirdparty viewer). See if the jaggies get blurred.


Hints

Note that it is the responsibility of the application program to specify the transparent polygons after all polygons behind them (back to front order).

We can reuse the tester and header. If you do not want to use your implementation of the transformations, do the following:

#define GLXFORM
Get matrices from GL and use gluProject to obtain screen space vertex positions
Implement gllColor. Use it to directly assign vertex colors to be interpolated.
subodh@cs.jhu.edu

-- The URL of this page is: http://www.cs.jhu.edu/~subodh/457/asn3.html --