Unformatted text preview:

6.837 F02 Assignment 3Wireframe RenderingOur tour of the classical graphics pipeline is nearly complete. Today, we consid-ered 3D scan-conversion algorithms, which operate by considering each raster of theviewport in turn, and processing all primitives which might contribute pixels to thatraster. This assignment challenges you to implement a wireframe scan conversionalgorithm for independent 3D triangles.We have modified the Inventor SceneViewer by adding several buttons to the leftof the viewport, to produce a new program called ivscan. While viewing an Inventorscene, pressing any of these buttons causes a series of C++ callbacks to occur. Onecallback per polygon edge is made to EdgeRec::Init(). One callback per frame ismade to RenderScene(). We have supplied incomplete versions of both routines.The assignment challenges you to complete the critical inner operations of both toproduce a semi-interactive wireframe renderer.EdgeRec::Init() takes as input a single polygon Edge (as defined in Edge.h).Each Edge record contains the 2D screen-space coordinates of the edge’s two vertices(for use in this assignment) and additional attributes such as depth and color (for usein Assignment 4). The method EdgeRec::Init() is called exactly once per edgefor each triangle that survives clipping (which we perform in ScanWrap.C). Youmust fill in EdgeRec::Init() so that it correctly initializes each relevant fieldof the EdgeRec. There are numerous comments in EdgeRec.C to guide you.RenderScene() is passed an Environment variable, and a function setPixel().The Environment data structure contains a viewport descriptor, a blank framebuffer,and a pointer to an EdgeRecTable. (The EdgeRecTable is one concrete implemen-tation – an array of linked lists of EdgeRecs – of the abstract “Event Bucket” datastructure described in class.) RenderScene() is called exactly once for each ren-dered scene (i.e., each time one of the scan conversion buttons in ivscan is pressed).Finally, you can use Raster.setPixel(x, color) to write a color value to a speci-fied pixel of the current raster, and Raster.write(y) to write the completed rasterinto the framebuffer.Your job is to fill in RenderScene() so that it produces, through a series ofcalls to RenderScanLine(), a correct wireframe image of the scene. Here, “correct”means that the boundaries of each input polygon are correctly rasterized as describedin lecture. Note that this assignment asks you to compute only wireframe rendering,with no color interpolation, depth interpolation, or span-filling. (Those elements willbe added in Assignment 4.)Extensive comments to guide you through both tasks can be found in the filesREADME, EdgeRec.C, EdgeRecList.C, and Scan.C. To complete this assignment,MIT 6.837 Computer Graphics Thursday, 26 September 2002 Page 1you need to modify only these three C files.The Point: First, you will implement the correct initialization of the EdgeRec andAEL (Active Edge List) data structures described in class. Second, you will imple-ment the incremental maintenance along polygon edges of x and y to achieve correctscan conversion. Third, you will understand the (integer-centered) screen-space co-ordinate model, and implement a sampling rule that renders polygon boundarieswithout dropouts or overdraws. See the README file for more details.Tools: On Athena, type (if necessary)attach 6.837Make a working directory, for example by doingmkdir /workingCopy the assignment source there:cp /mit/6.837/F02/asst3/irix,linux/ivscan.tar~/workingGo to a working directory of your choice:cd~/workingUnpack the assignment source of your choice, producing directory ivscan:tar xvf ivscan.tarGo to the ivscan directory, read the README, and make the executable:cd ivscan; cat README; makeNow you can run the (incomplete) executable :ivscan.irix foo.iv or ivscan.linux foo.ivwhere foo.iv is any inventor file.A “reference executable” that exhibits the correct behavior can be found at/mit/6.837/F02/asst3/irix,linux/ivscanEvaluation: We expect your ivscan to correctly scan-convert all of the includedtest Inventor files, from any view point. We will also test it against several morechallenging Inventor objects.To turn in (details TBA by email, and online):• Your modified EdgeRec.C, EdgeRecList.C, and Scan.C;• Any other .C or .h files you modify;• Your stripped executable ivscan.irix or ivscan.linux. (We use this namingconvention to know which OS to use when building and running your code.)We will test your source for compilation using the assignment Makefile on eitherLinux or Irix (we will not support other architectures for this assignment). Thus youmust include any files that you have modified (we will supply unmodified files fromthe assignment source).This assignment is due 5pm Friday, 4 October 2002.MIT 6.837 Computer Graphics Thursday, 26 September 2002 Page


View Full Document

MIT 6 837 - Wireframe Rendering

Documents in this Course
Shadows

Shadows

64 pages

Animation

Animation

37 pages

Radiosity

Radiosity

25 pages

Color

Color

86 pages

InterArch

InterArch

14 pages

Color

Color

15 pages

Animation

Animation

61 pages

Luxo Jr

Luxo Jr

14 pages

Animation

Animation

52 pages

Radiosity

Radiosity

37 pages

Load more
Download Wireframe Rendering
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Wireframe Rendering and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Wireframe Rendering 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?