COS 426 Computer Graphics - Fall 1997

COS 426 Home

Projects

Project 0

Project 1 (hints)

Project 2 (hints)

Project 3 (hints)

Project 4 (hints)

Project 5 (hints)

Project 6
General hints
  • First of all, go to the precepts either Mon 8:00pm or Thu 3:30pm in CS Bldg. 105.
  • Next, make use of our office hours and lab hours.
  • Also, you can always send us e-mail or post questions to the newsgroup.
  • Check out how to setup your account to run the COS 426 programs.
Project 1 hints
  • To draw filled triangles, use the simple sweep-line algorithm for triangles, as described on pp. 3-4 of lecture notes #2.
  • To draw filled convex polygons, simply triangulate the polygon and then draw all the triangles using the code for triangles.
  • To draw filled concave polygons (extra credit) use the more complex sweep-line algorithm (pp. 14-16 of lecture notes #2, or H&B sec 3-11.) for polygons.
  • If you wish to implement Gupta-Sproull antialiased lines for extra credit, there is a good discussion (and some pseudocode) in Foley, et al.
  • To implement the "print" feature, check out this brief description of postscript.
  • Some frequently asked questions:
    How do I set a pixel on the canvas?
    Using dev_set_pixel(x, y).
    Do we have to do any TCL coding?
    For the required part, you don't have to. But depending on the extra credit options you choose, you might have to.
    In my.c, some functions have a vertex_t * parameter. Is this a pointer to only one vertex or to the beginning of an array of vertices?
    It is a pointer to the beginning of an array of vertices. How many vertices? It depends on the object (take a look at graphics.h).
    Where should the code for circle rendering go?
    What about circle.c? Don't forget to add TOOL_CIRCLE cases in app.c, OBJ_CIRCLE cases in graphics.c, and circle.c in the source list in the Makefile.
    How can I debug Tcl code?
    You have to debug the interpreter that runs the Tcl code. For example, suppose you want to debug the function app_click1() in app.c:

    /u/you/cs426/1> gdb drawsh
    (gdb) b app_click1
    (gdb) run
    % source draw.tcl
  • For triangle scan conversion, you don't have to use Bresenham's algorithm, but you can for extra credit. See the course newsgroup for a more elaborate discussion.
  • Stay tuned for more...

Last update: Sun Nov 30 18:08:17 EST 1997