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

cmsc427 rendering polylines
SMART_READER_LITE
LIVE PREVIEW

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);


slide-1
SLIDE 1

CMSC427 Rendering polylines

slide-2
SLIDE 2

Points, polylines and polygons

Points Polyline Polygon Polyline can be rendered as each

slide-3
SLIDE 3

Points, polylines and polygons

Points Polyline Polygon

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

slide-4
SLIDE 4

OpenGL primitives (WebGL version)

slide-5
SLIDE 5

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

slide-6
SLIDE 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.

slide-7
SLIDE 7

Order of vertices to triangle strip this polygon?

A B C D E F G H I

slide-8
SLIDE 8

Order of vertices to triangle strip this polygon?

A B C D E F G H I

slide-9
SLIDE 9

Order of vertices to triangle fan this polygon?

H A B C D E F G

slide-10
SLIDE 10
  • 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()
  • pYons 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. What you should know after today

slide-11
SLIDE 11
  • Processing
  • hMps://processing.org
  • Example program TriStripLabeled.pde

Today’s resources