Set your presentation theme:
Black (default) -
White -
League -
Sky -
Beige -
Simple
Serif -
Blood -
Night -
Moon -
Solarized
H:
Jean Pierre Charalambos
Universidad Nacional de Colombia
Presentation best seen online
See also the source code
H:
- Intro
- Graphics Pipeline & Polygonal Meshes
- Polygonal Meshes Representation
- Vertex-vertex meshes & Explicit representation
- Face-vertex meshes & Face-edge meshes
- OpenGL Polygonal Meshes
- Deprecated Immediate Mode
- Modern Immediate Mode
- Modern Retained Mode
- Processing and Proscene Polygonal Meshes
- Immediate Mode & Retained Mode
H:
- Graphics Pipeline
- Polygonal Meshes
V:
V:
The Standford BunnyV:
InteriorV:
Polygonal Terrain MeshV:
Level-Of-Detail (LOD)V:
V:
V:
-
Immediate Mode
- lists of objects to be rendered are NOT saved by GL
- each frame: app must re-issue all drawing commands
- Maximum control and flexibility by the app
-
Retained Mode
- lists of objects to be rendered are saved by GL
- each frame: app calls -> update model
- Allows GL to optimize rendering (when, processing,...)
N:
- Immediate Mode -> app must re-issue all drawing commands required to describe the entire scene
- Retained mode -> models should be generated first
H:
- Vertex-vertex meshes
- Explicit representation
- Face-vertex meshes
- Face-edge meshes
V:
N:
- simplest representation
- not widely used: faces are implicit
- small storage space
- efficient morphing of shape
V:
N:
- simple representation
- widely used: faces are explicit
- higher storage space
- inefficient morphing of shape
V:
N:
- most widely used (see OpenGL section)
- lower storage space
- efficient morphing of shape
V:
N:
- Same but lists faces that surround a vertex
V:
N:
- Similar than fv's, but adds edge info
- Hard to find vertex incident edges
V:
- Half-edges -> split edges in two oriented parts
- Half-edges store the main connectivity information:
N:
V:
Vertex one-ring neighborhoodN:
- Critical operation for several algorithms
V:
[Winged-edge](https://en.wikipedia.org/wiki/Polygon_mesh#Winged-edge_meshes)V:
Check the comparative table
H:
- Deprecated Immediate Mode
- Modern Immediate Mode
- Modern Retained Mode
N:
- Old fashioned Retained Mode: Display Lists
V:
// Same as explicit mesh representation
// Draw a cube
// 36 of vertex coords: 3 vertices per tri
// 12 tris (2 per face)
glBegin(GL_TRIANGLES);
// front face =================
glVertex3f(x0,y0,z0); // v0
glVertex3f(x1,y1,z1); // v1
glVertex3f(x2,y2,z2); // v2
glVertex3f(x2,y2,z2); // v2
glVertex3f(x3,y3,z3); // v3
glVertex3f(x0,y0,z0); // v0
// right face =================
glVertex3f(x0,y0,z0); // v0
glVertex3f(x3,y3,z3); // v3
glVertex3f(x4,y4,z4); // v4
glVertex3f(x4,y4,z4); // v4
glVertex3f(x5,y5,z5); // v5
glVertex3f(x0,y0,z0); // v0
... // draw other 4 faces
glEnd();N:
- Same as explicit mesh representation.
- Geometry should be transfer every frame.
V:
// Same as face-vertex mesh representation
// Draw a cube where somewhere in your application you have:
// v0 : [x0,y0,z0]
// v1 : [x0,y0,z0]
// ...
// v7 : [x7,y7,z7]
glBegin(GL_TRIANGLES);
// front face =================
// v0-v1-v2
glVertex3fv(v0);
glVertex3fv(v1);
glVertex3fv(v2);
// v2-v3-v0
glVertex3fv(v2);
glVertex3fv(v3);
glVertex3fv(v0);
// right face =================
// v0-v3-v4
glVertex3fv(v0);
glVertex3fv(v3);
glVertex3fv(v4);
// v4-v5-v0
glVertex3fv(v4);
glVertex3fv(v5);
glVertex3fv(v0);
... // draw other 4 faces
glEnd();N:
- Same as face-vertex mesh representation.
- Geometry should be transfer every frame.
V:
Immediate mode: Vertex Arrays / glVertexPointer() / glDrawArrays()
// Same as explicit mesh representation
GLfloat vertices[] = {...}; // 36 of vertex coords
...
// activate and specify pointer to vertex array
glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(3, GL_FLOAT, 0, vertices);
// draw a cube
glDrawArrays(GL_TRIANGLES, 0, 36);
// deactivate vertex arrays after drawing
glDisableClientState(GL_VERTEX_ARRAY);N:
- Same as explicit mesh representation
V:
Immediate mode (specification & rendering): Vertex Arrays / glVertexPointer() / glDrawElements()
// Same as face-vertex mesh representation
GLfloat vertices[] = {...}; // 8 of vertex coords
GLubyte indices[] = {0,1,2, 2,3,0, // 36 of indices
0,3,4, 4,5,0,
0,5,6, 6,1,0,
1,6,7, 7,2,1,
7,4,3, 3,2,7,
4,7,6, 6,5,4};
...
// activate and specify pointer to vertex array
glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(3, GL_FLOAT, 0, vertices);
// draw a cube
glDrawElements(GL_TRIANGLES, 36, GL_UNSIGNED_BYTE, indices);
// deactivate vertex arrays after drawing
glDisableClientState(GL_VERTEX_ARRAY);N:
- Same as face-vertex mesh representation
V:
Retained mode: (VBOs specification) / glVertexPointer() / glDrawElements()
// Same as face-vertex mesh representation
GLfloat vertices[] = {...}; // 8 of vertex coords
GLubyte indices[] = {0,1,2, 2,3,0, // 36 of indices
0,3,4, 4,5,0,
0,5,6, 6,1,0,
1,6,7, 7,2,1,
7,4,3, 3,2,7,
4,7,6, 6,5,4};
...N:
- Same access functions as with vertex-arrays
V:
Retained mode: (VBOs generation and transfer) / glVertexPointer() / glDrawElements()
// Generate 2 VBOs
glGenBuffers(2, vboIds);
// Transfer vertex data to VBO 0
glBindBuffer(GL_ARRAY_BUFFER, vboIds[0]);
glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW);
// Transfer index data to VBO 1
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, vboIds[1]);
glBufferData(GL_ELEMENT_ARRAY_BUFFER,sizeof(indices),indices,GL_STATIC_DRAW);V:
Retained mode: (VBOs rendering) / glVertexPointer() / glDrawElements()
glBindBufferARB(GL_ARRAY_BUFFER_ARB, vboId1);
glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, vboId2);
...
// activate and specify pointer to vertex array
glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(3, GL_FLOAT, 0, 0);
// draw a cube
glDrawElements(GL_TRIANGLES, 36, GL_UNSIGNED_BYTE, 0);
// deactivate vertex arrays after drawing
glDisableClientState(GL_VERTEX_ARRAY);V:
glDrawElements() modes
- GL_POINTS
- GL_LINE_STRIP, GL_LINE_LOOP, GL_LINES, GL_LINE_STRIP_ADJACENCY, GL_LINES_ADJACENCY
- GL_TRIANGLE_STRIP
- GL_TRIANGLE_FAN
- GL_TRIANGLES
- GL_TRIANGLE_STRIP_ADJACENCY
- GL_TRIANGLES_ADJACENCY
- GL_PATCHES
H:
beginShape(TRIANGLE_STRIP);
vertex(30, 75);
vertex(40, 20);
vertex(50, 75);
vertex(60, 20);
vertex(70, 75);
vertex(80, 20);
vertex(90, 75);
endShape();N:
- Same as explicit mesh representation, i.e., face-vertex mesh representation is missed
V:
PShape s;
void setup() {
size(100, 100, P2D);
s = createShape();
s.beginShape(TRIANGLE_STRIP);
s.vertex(30, 75);
s.vertex(40, 20);
s.vertex(50, 75);
s.vertex(60, 20);
s.vertex(70, 75);
s.vertex(80, 20);
s.vertex(90, 75);
s.endShape();
}
void draw() {
shape(s, 0, 0);
}N:
- Same as explicit mesh representation, i.e., face-vertex mesh representation is missed
V:
- POINTS
- LINES
- TRIANGLES
- TRIANGLE_STRIP
- TRIANGLE_FAN
- QUADS
- QUAD_STRIP
V:
Processing Polygonal Meshes: hemesh
V:
Processing Polygonal Meshes: hemesh
- Creation
- Modification
- Subdivision
- Selection
H:
Polygonal meshes
V:
OpenGL
V:
Processing
- Processing Immediate Mode: All
beginShape/endShapeexamples - Processing Retained mode: All
PShapeexamples - Processing Low-Level, via OpenGL















