cmsc427 rendering polylines
play

CMSC427 Rendering polylines Points, polylines and polygons Points - PowerPoint PPT Presentation

CMSC427 Rendering polylines Points, polylines and polygons Points Polyline Polygon Polyline can be rendered as each Points, polylines and polygons hMps://processing.org/reference/beginShape_.html Points Polyline Polygon beginShape(POINTS);


  1. CMSC427 Rendering polylines

  2. Points, polylines and polygons Points Polyline Polygon Polyline can be rendered as each

  3. Points, polylines and polygons hMps://processing.org/reference/beginShape_.html Points Polyline Polygon beginShape(POINTS); noFill(); fill(255); vertex(30, 75); // v0 beginShape(); beginShape(); vertex(40, 20); // v1 vertex(30, 75); // v0 vertex(30, 75); // v0 vertex(50, 75); // v2 vertex(40, 20); // v1 vertex(40, 20); // v1 ... vertex(50, 75); // v2 vertex(50, 75); // v2 endShape(); ... ... endShape(); endShape(CLOSE);

  4. OpenGL primitives (WebGL version)

  5. Triangle strips and efficiency Vertex in red is shared with how many triangles?

  6. Triangle strips and efficiency beginShape(TRIANGLE_STRIP); vertex(30, 75); // v0 vertex(40, 20); // v1 vertex(50, 75); // v2 vertex(60, 20); // v3 vertex(70, 75); // v4 vertex(80, 20); // v5 vertex(90, 75); // v6 endShape(CLOSE); VerYces belonging to mulYple triangles not repeated.

  7. Order of vertices to triangle strip this polygon? H F I G E B D A C

  8. Order of vertices to triangle strip this polygon? H F I G E B D A C

  9. Order of vertices to triangle fan this polygon? D C E F G H B A

  10. What you should know after today 1. Polylines can be rendered in mulYple ways, from points to triangles to strips to fans. 2. How to look up and use the beginShape() opYons in Processing (or similar mechanisms in OpenGL, WebGL, etc.) 3. That strips and fans allow for efficient transmission of verYces. 4. How to order verYces to make a strip or fan.

  11. Today’s resources • Processing • hMps://processing.org • Example program TriStripLabeled.pde

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend