















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!
















3D Modeling
n Previously n Introduced 3D modeling n Previously introduced GLUT models (wireframe/solid) and Scene Description Language (SDL): 3D file format n Previously used GLUT calls
Polygonal Meshes
n Have become standard in CG n OpenGL
n Simple meshes exact. (e.g barn) n Complex meshes approximate (e.g. human face) n Later: use shading technique to smoothen
Non-solid Objects
n Examples: box, face n Visualize as infinitely thin skin n Meshes to approximate complex objects n Shading used later to smoothen n Non-trivial: creating mesh for complex objects (CAD)
Vertex Normal
n Use vertex normal instead of face normal n See advantages later:
Defining Polygonal Mesh
n Use barn example below:
Newell Method for Normal Vectors
n Martin Newell at Utah (teapot guy) n Normal vector:
n Simple approach used previously:
0 (^ ) i next i
0 (^ ) i next i
y (^) i i next i
0 (^ ) i next i
Meshes in Programs
n Class Mesh n Helper classes
n Mesh Object:
n Use arrays of pt, norm, face n Dynamic allocation at runtime n Array lengths: numVerts, numNormals, numFaces
Meshes in Programs
n Face:
n Example, vth vertex of fth face:
n Organized approach, permits random access
Meshes in Programs
n Data structure:
Meshes in Programs
Drawing Meshes Using OpenGL
n Actual code:
Drawing Meshes Using SDL
n Scene class reads SDL files n Accepts keyword Mesh n Example: