filling the pipeline
play

Filling The Pipeline CS418 Computer Graphics John C. Hart Window - PowerPoint PPT Presentation

Filling The Pipeline CS418 Computer Graphics John C. Hart Window Coordinates (1,1) (-1,1) (-1,-1) (1,-1) Points (1,1) (-1,1) [-0.6, 1.0, -0.6, 0.6, -0.2, 0.6, -0.2, -0.6, -0.6, -0.6, -0.6, -1.0, 0.6, -1.0, 0.6, -0.6, 0.2, -0.6,


  1. Filling The Pipeline CS418 Computer Graphics John C. Hart

  2. Window Coordinates (1,1) (-1,1) (-1,-1) (1,-1)

  3. Points (1,1) (-1,1) [-0.6, 1.0, -0.6, 0.6, -0.2, 0.6, -0.2, -0.6, -0.6, -0.6, -0.6, -1.0, 0.6, -1.0, 0.6, -0.6, 0.2, -0.6, 0.2, -0.6, 0.6, 0.6, 0.6, 1.0]; gl.drawArrays( gl. POINTS ,…) (-1,-1) (1,-1)

  4. Lines (1,1) (-1,1) [-0.6, 1.0, -0.6, 0.6, -0.2, 0.6, -0.2, -0.6, -0.6, -0.6, -0.6, -1.0, 0.6, -1.0, 0.6, -0.6, 0.2, -0.6, 0.2, -0.6, 0.6, 0.6, 0.6, 1.0]; gl.drawArrays( gl. LINES ,…) (-1,-1) (1,-1)

  5. Line Strip (1,1) (-1,1) [-0.6, 1.0, -0.6, 0.6, -0.2, 0.6, -0.2, -0.6, -0.6, -0.6, -0.6, -1.0, 0.6, -1.0, 0.6, -0.6, 0.2, -0.6, 0.2, -0.6, 0.6, 0.6, 0.6, 1.0]; gl.drawArrays( gl. LINE_STRIP ,…) (-1,-1) (1,-1)

  6. Line Loop (1,1) (-1,1) [-0.6, 1.0, -0.6, 0.6, -0.2, 0.6, -0.2, -0.6, -0.6, -0.6, -0.6, -1.0, 0.6, -1.0, 0.6, -0.6, 0.2, -0.6, 0.2, -0.6, 0.6, 0.6, 0.6, 1.0 ]; gl.drawArrays( gl. LINE_LOOP ,…) (-1,-1) (1,-1)

  7. Triangles (1,1) (-1,1) [-0.6, 1.0, -0.6, 0.6, -0.2, 0.6, -0.2, -0.6, -0.6, -0.6, -0.6, -1.0, 0.6, -1.0, 0.6, -0.6, 0.2, -0.6, 0.2, -0.6, 0.6, 0.6, 0.6, 1.0]; gl.drawArrays( gl. TRIANGLES ,…) (-1,-1) (1,-1)

  8. Triangles (1,1) (-1,1) [-0.6, 1.0, -0.6, 0.6, -0.2, 0.6, -0.6, 1.0, -0.2, 0.6, 0.6, 1.0, -0.2, 0.6, 0.2, 0.6, 0.6, 1.0, 0.2, 0.6, 0.6, 0.6, 0.6, 1.0, …]; gl.drawArrays( gl. TRIANGLES ,…) (-1,-1) (1,-1)

  9. No T Vertices! (1,1) (-1,1) Triangle edges should NEVER pass through a neighboring vertex (-1,-1) (1,-1)

  10. Triangle Strip (1,1) (-1,1) [-0.6, 1.0, -0.6, 0.6, -0.2, 0.6, -0.2, -0.6, -0.6, -0.6, -0.6, -1.0, 0.6, -1.0, 0.6, -0.6, 0.2, -0.6, 0.2, -0.6, 0.6, 0.6, 0.6, 1.0]; gl.drawArrays( gl. TRIANGLE_STRIP ,…) (-1,-1) (1,-1)

  11. Triangle Strip First two vertices prime the pump, then every new vertex creates a triangle connecting it to the previous two vertices (1,1) (-1,1) [-0.6, 1.0, 0.6, 1.0, -0.2, 0.6, 0.2, 0.6, -0.2, -0.6, 0.2, -0.6, 0.6, -1.0, 0.6, -0.6]; […]; gl.drawArrays( gl. TRIANGLE_STRIP ,…) (-1,-1) (1,-1)

  12. First two vertices prime the pump, Triangle Fan then every new vertex creates a triangle connecting it to the previous vertex and the first vertex (1,1) (-1,1) [-0.2, 0.6, -0.6, 0.6, -0.6, 1.0, 0.6, 1.0, 0.2, 0.6, 0.2, -0.6, -0.2, -0.6]; […]; […]; […]; gl.drawArrays( gl. TRIANGLE_FAN ,…) (-1,-1) (1,-1)

  13. Indexed Face Set ( x 4 , y 4 , z 4 ) ( x 3 , y 3 , z 3 ) • Popular file format – VRML, Wavefront “.obj”, etc. • Ordered list of vertices ( x 2 , y 2 , z 2 ) ( x 1 , y 1 , z 1 ) – Prefaced by “v” (Wavefront) – Spatial coordinates x,y,z v x 1 y 1 z 1 – Index given by order v x 2 y 2 z 2 • List of polygons v x 3 y 3 z 3 – Prefaced by “f” (Wavefront) v x 4 y 4 z 4 – Ordered list of vertex indices – Length = # of sides f 1 2 3 – Orientation given by order f 2 4 3

Recommend


More recommend