03-hiermodel

# 03-hiermodel - Lecture 3 Hierarchical Modeling Reading...

This preview shows pages 1–12. Sign up to view the full content.

Lecture 3 Hierarchical Modeling

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Reading Recommended: • OGL Red Book Chapter 1-2 Further reading: • Angel 8.1-8.6
Lecture outline: 1. Graphics Primitives: Points, Lines, and Triangles 2. Data structure: vertex list and index list 3. Hierarchical structure 4. View-world or Modelview transformations 5. Basic scenegraph concept

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Graphics Primitives: glBegin ( type ) ; glVertex ( ) ; glVertex ( ) ; glVertex ( ) ; …… glEnd() ; It’s all about coordinates and connectivity
Graphics Primitives: glBegin ( type ) ; glVertex3f ( ) ; glVertex3f ( ) ; glVertex3f ( ) ; …… glEnd() ; (x, y, z, 1) A 3D Mesh (shown as a wireframe)

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Graphics Primitives: Geometry Engine Points (GL_POINTS) OR Lines (GL_LINE*) OR Triangles (other) tessellation / triangulation * Why triangles? We will see this later in the scan conversion lecture glBegin ( type ) ; glVertex3f ( ) ; glVertex3f ( ) ; glVertex3f ( ) ; …… glEnd() ; A 3D Mesh Break down
Graphics Primitives: Question: which input type is the most efficient one for rendering polygons? -Answer: Triangle strip (preferred) or Triangle fan - Because more polygons with fewer input vertices and no tessellation needed - Some software to break down a 3D mesh into triangle strips for efficient rendering, e.g. tri stripper, NVtristrip (NVidia), or OpenGL optimizer (SGI) - See http://www.plunk.org/~grantham/public/meshifier/oldmesh.html http://developer.nvidia.com/object/nvtristrip_library.html http://www.opengl.org/resources/faq/technical/performance.htm#perf0030 Example: four tri. strips

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Data structure (1) Vertex set (storing one array with vertex coordinates) Vertex List Vertex # Coordinates 1 x1,y,1z1 2 x2,y2,z2 3 x3,y3,z3 4 x4,y4,z4 5 x5,y5,z5 6 x6,y6,z6 7 x7,y7,z7 8 x8,y8,z8 Triangle number 1 Triangle number 2 Good: sequential memory access Bad: it is very likely to have duplicated vertices in the list e.g. float coords[N][3];
Data structure (2) Indexed Face Set (one more array for indices) Vertex List Vertex # Coordinates 1 x1,y,1z1 2 x2,y2,z2 3 x3,y3,z3 4 x4,y4,z4 5 x5,y5,z5 6 x6,y6,z6 7 x7,y7,z7 8 x8,y8,z8 Bad: random memory access (may have cache miss) Good: reuse vertices and keeps a compact Vertex list e.g. float coords[N][3]; int tri_index[N][3]; Face List a mesh Polygon # Vertex List 1 V1,V2,V3 2 V1,V4,V8 3 V5,V6,V2 4 V2,V6,V7 5 V4,V3,V8 6 V5,V8,V7 Need delimitors (-1) or an additional field for Vertex count if number of vertices per polygon is flexible

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Data structure Note: 1. Triangle strip can be implemented on either data structure 2. Some high level APIs like VRML, Inventor, etc. have these data structure in-built and we can input the two lists directly 3. The Vertex ID of the first vertex in the vertex list may starts from 0 or 1, depending on which API / file format: e.g. VRML starts from 0 and obj (3D file format) starts from 1 Check: http://astronomy.swin.edu.au/~pbourke/geomformats/
Data structure Example: Indexed Line Set in VRML:

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 10/19/2009 for the course COMP 341 taught by Professor Qu,huamin during the Spring '09 term at HKUST.

### Page1 / 31

03-hiermodel - Lecture 3 Hierarchical Modeling Reading...

This preview shows document pages 1 - 12. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online