CS 6490 -- 3D Graphics

Group: Nice Try

Program 1 Report

Due: September 30th

Team members:

    Vivek Kwatra -- kwatra@cc.gatech.edu
                    Anna Shleyfman -- shleyf@cc.gatech.edu
                                    Roman Khramets -- khramez@cc.gatech.edu
     
1. What we've accomplished for this assignment

We succeeded in completion of all of the mandatory procedures, i.e.:

  1. Reading the input file and constructing the X,Y,Z and the A,B, and C arrays
  2. Computing and storing the triangle normals as cross-products of their edges
  3. Constructing the S and O arrays of the half-edge data-structure defined in class
  4. Compute outward pointing normal for triangle 1
  5. Using S and O arrays to visit triangles and flip normals when inconsistent
  6. Displaying the consistently oriented mesh using open GL in flat shaded mode
  7. Framing the mesh at the center of the screen and rotating it 1000 times
  8. Using the half-edge data structure to visit all vertices and compute their normals through averaging
  9. Display the rotating model that toggles every 10 frames between flat and Gouraud shading

  10. Here are some of the examples generated by our program:


Also for extra credit we completed the following procedures:

  1. Reporting the number of shells (edge-connected components) on the graphics screen
  2. For each shell, printing on the graphic screen, the number of vertices, triangles, handles
  3. Constructing generalized triangles strips from the runs of the triangle-spanning tree
  4. Rendering the model as triangle strips (sending the vertex twice for swaps)
  5. Showing each triangle strips shaded in a different color with edges super-imposed`
  6. Print statistics of the average length of the strips
  7. Some elementary performance comparison between triangle strips and individual triangle rendering modes
Several examples that were generated by computing the triangle stripes:



2. Assumptions


3. Description of solution

We used the following concepts from the lecture notes to write the algorithm:

  • How to build o&r (edge) table?

    Read the vertex table

  • Fill o and e, v1, v2 entries 3 per triangle (create extra table e,v1,v2)
    if (V1 > V2) flip V1 and V2
    Sort table e, v1,v2 by v1 || v2

    By the time you finish sorting reverse edges are next to each other
     

    We used this algorithm to compute average normal for a vertex.
     
  •  Extra Credit

    Generated triangle strips from the data structure by traversing  the triangles in a left-right  fashion, alternately - the way OpenGL renders them and storing the sequenced vertices in  a data structure. Calculated and displayed average length of triangle strips.

    Calculated number of shells, and triangles, vertices and handles for each and displayed it on the  Graphic Screen using Bitmap fonts.

    We ran  gprofile  for  comparing the two schemes ( strips and individual triangle rendering ) . In our framework we obtained similar performance characteristics,  probably due to insufficiently complicated models. Qualitatively, both gave similar results with Gouraud shading, but in the case of flat shading, we could not send actual triangle normals with the vertices in case of triangle strips, thus obtaining aliased images.  With individual triangles, it was easier to send their true normals and thus obtain a better image.

  •  
    4. How to run the program
    Note: this code was writen for LINUX operating system.  It is not guaranteed to run under any other system.
    Our code is located at http://www.prism.gatech.edu/~gt1387a/cs6490/code