Home
Teaching
Research
Publications
Profile
Miscellany
|
Current Course (intinno)
Computer Graphics (CS43302: Spring 2009) CSE Class Room 119
|
| 7.30 | 8.30 | 9.30 | 10.30 | 11.30 | 1.30 | 2.30 | 3.30 | 4.30 |
Mon | | Graphics | |
Tue | Graphics | |
Wed | | Graphics Lab | |
Thu | | Graphics* | |
Fri | |
|
Teaching Assistants
- Debkumar Patra (dkpatra@cse.iitkgp.ernet.in)
- Shyamosree Pal (shyamosree@cse.iitkgp.ernet.in, shyamosree.pal@gmail.com)
Books
- Computer Graphics - Principles and Practice.
J. D. Foley, A. Dam, S. K. Feiner, and J. F. Hughes, Addison-Wesley, Reading (Mass.), 1993.
- Computer Graphics. D. Hearn and M. P. Baker, PHI, 1995.
- Introduction to Computer Graphics. J.D. Foley, A. van Dam, S.K. Feiner, J.F. Hughes, and R.L. Philips, Addison-Wesley, 1994.
- Introduction to Computing with Geometry. A. Bowyer and J. Woodwark, 1993.
(pdf)
Reference Books / Manuals
- Computer Graphics Using OpenGL. F.S. Hill and S. M. Kelley, Pearson Education, 2009 (Indian print).
- Interactive Computer Graphics: A Top-Down Approach with OpenGL. Edward Angel, Addison-Wesley, 1997 (Reprinted with corrections, January 2000).
- OpenGL Programming Guide. Jackie Neider et al., Addison-Wesley, 1993.
- OpenGL Reference Manual. Addison-Wesley, 1992.
- Principles of Digital Image Synthesis. Andrew S. Glassner, Morgan Kaufmann (two volumes), 1995.
- 3D Computer Graphics. Alan Watt, 3rd Edition, Addison-Wesley, 2000.
- Java™—How to Program. P.J. Deitel and H.M. Deitel, PHI (7th edition).
Other Resources
Assignments
- Grid: [submission: Jan 14]
Construct a square grid with origin (0, 0) at center of the display screen.
Use white (255, 255, 255) as the background color and (200, 200, 200) as the grid color.
Show the x-axis and the y-axis with color (0, 0, 200).
Buttons:
- grid size increase (× 2) and decrease (÷ 2)
- grid OFF/ON (radio button)
- axes OFF/ON (radio button)
Note: This grid should be used in the subsequent assignments.
- DSS: [submission: Jan 21]
Write a program to draw a digital straight line segment (DSS) pq,
which is t (= 1, 3, 5, ...) grid units thick, connecting two given points p and q,
using Bresenham's algorithm.
User input:
- p (mouse click)
- q (mouse click)
- t (keyboard input in GUI)
- other grid buttons
You should do this assignment in steps as follows:
- Write the program to draw a line with slope from 0 degree to 45 degrees.
- Modify the program in Step 1 to draw a line with any slope.
The user may specify/click any point as the start point and any point as the end point of a DSS.
Now implement a function that will increase the thickness of the DSS, depending on user's choice.
Consider that user will use the thickness button to increase or decrease the thickness.
Note that, a thick line, say of thickness = 11 grid units, will look like a bar
(tilted bar, in case of an inclined line) of 11 grid units thickness and the bar will be always solid.
That is, all grid points within the bar (of any slope) should be made ON.
An example of a small DSS with thickness 11 units is given below.
Note that, each grid point lying inside the bar is made ON.
The original DSS is shown in black, and the thickened part in gray.
You may, of course, color the thick line as you like.
- Use the above program to draw a thick and simple polygon P. As the user clicks the vertices
one by one, the polygon construction should progress instantaneously until the user
presses the finish button.
Checks should be there to test the simpleness of P—
i.e., whether every new edge defined by the new vertex is non-intersecting with all other
previous edges of P.
In case it violates simpleness, pop up a message to the user asking for a proper vertex;
and in case the user clicks a vertex coinciding with the first vertex, finish the polygon P
although the user has not pressed the finish button.
- 2D+3D Curve Drawing: [submission: Feb 18]
- Draw a 2D curve using B-spline interpolation as follows.
User specifies the sequence of control points S by pressing
the left mouse button or similar input.
If the pressed point does not coincide with any grid point,
then you have to select the nearest (or one such nearest) grid point.
Draw a sequence S' of B-spline segments in a way such that
(a) each point of S' is a grid point;
(b) the digital curve S' is minimally connected (i.e., irreducible in nature).
- Dynamically (but locally, a B-spline feature!) change S' as the user performs
the following operations T on any control point in S:
(a) insertion of a new c.p.
(b) deletion of an existing c.p.
(c) shifting/translating an existing c.p.
- Extend it to 3D curve drawing with the following assumptions:
(a) S (i.e., sequence of c.p.s in S) is either y-monotone or x-monotone.
(b) If S is y-monotone, then use the grid as yz-plane and perform operations
of T (Step 2) on c.p.s of S to define the z-coordinates of the c.p.s.
Error checks and related messages should be there in case the y-monotone property
of S is at stake.
Draw projection S" of the 3D curve S' on xy/yz/zx-grid as the user specifies,
and check whether S" satisfies Properties a and b of Step 1.
- Surface of revolution: [submission: March 5]
- Translate the (irreducible) digital curve C that you created in the previous assignment
by [t, 0, –t], where t is user-specified.
Consider C to be such that C is y-monotone and each point of C has z=0.
Default value of t may be ρ plus length or breadth of the curve C, whichever is greater.
Consider an axis of rotation orthogonal to the zx-plane: z=–t, x=t–ρ.
Generate the surface of revolution, S, such that there lies no missing voxel in S.
- Apply the ray-tracing/z-buffer algorithm to render the projection S' of S.
- Compute the normals (nr, nC) and their resultants
(vector sum n of nr and nC) at each point of S and show
their projections (of suitable lengths and at suitable intervals) also
in three different colors. There should be three radio buttons to make the three normals
OFF/ON.
- Apply illumination on S with all parameters user-specified and initialized
with proper default values.
Note:
- All parameters (t, ρ, viewing parameters, illumination parameters,
color palettes for light sources, background, and characteristic color of S,
etc.) should be initialized with suitable default values and should also have proper
input mechanism from the user.
- C should be drawn in a user-friendly way: As the control points (c.p.)
are given as input one by one, C should be drawn in an incremental fashion after
the first 4 c.p.s.
- The user may give duplicate/ triplicate/ quadruplicate c.p.s coinciding
at the same point which should be considered as separate c.p.s.
- The surface S should not have any pore or missing voxel. A missing voxel
may lie between two consecutive digital circles (i.e, having z=z' and z=z'+1)
only if they have consecutive radii (i.e, r=r' and r=r'+1).
Earlier Courses
Design and Analysis of Algorithms (Autumn 2008)
|
|