CS 543: Computer Graphics Lecture 5: 3D Modeling: Polygonal Meshes. Emmanuel Agu

Similar documents
Computer Graphics CS 543 Lecture 12 (Part 1) Curves. Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)

3D shapes. Level A. 1. Which of the following is a 3-D shape? A) Cylinder B) Octagon C) Kite. 2. What is another name for 3-D shapes?

Introduction to Computer Graphics

2: Introducing image synthesis. Some orientation how did we get here? Graphics system architecture Overview of OpenGL / GLU / GLUT

Computer Applications in Textile Engineering. Computer Applications in Textile Engineering

Vector Math Computer Graphics Scott D. Anderson

Angle - a figure formed by two rays or two line segments with a common endpoint called the vertex of the angle; angles are measured in degrees

Graphics Pipeline in a Nutshell

Monash University Clayton s School of Information Technology CSE3313 Computer Graphics Sample Exam Questions 2007

Activity Set 4. Trainer Guide

H.Calculating Normal Vectors

Algebra Geometry Glossary. 90 angle

Angles that are between parallel lines, but on opposite sides of a transversal.

Pre-Algebra Academic Content Standards Grade Eight Ohio. Number, Number Sense and Operations Standard. Number and Number Systems

Platonic Solids. Some solids have curved surfaces or a mix of curved and flat surfaces (so they aren't polyhedra). Examples:

A Short Introduction to Computer Graphics

Everyday Mathematics. Grade 4 Grade-Level Goals CCSS EDITION. Content Strand: Number and Numeration. Program Goal Content Thread Grade-Level Goal

Lecture Notes. Fundamentals of Computer Graphics. Prof. Michael Langer School of Computer Science McGill University

Everyday Mathematics. Grade 4 Grade-Level Goals. 3rd Edition. Content Strand: Number and Numeration. Program Goal Content Thread Grade-Level Goals

MATHEMATICS FOR ENGINEERING BASIC ALGEBRA

Shape Dictionary YR to Y6

INTRODUCTION TO RENDERING TECHNIQUES

Lecture Notes, CEng 477

Algebra Academic Content Standards Grade Eight and Grade Nine Ohio. Grade Eight. Number, Number Sense and Operations Standard

CSE 564: Visualization. GPU Programming (First Steps) GPU Generations. Klaus Mueller. Computer Science Department Stony Brook University

GUI GRAPHICS AND USER INTERFACES. Welcome to GUI! Mechanics. Mihail Gaianu 26/02/2014 1

Instructor. Goals. Image Synthesis Examples. Applications. Computer Graphics. Why Study 3D Computer Graphics?

Introduction Week 1, Lecture 1

Computer Graphics. Geometric Modeling. Page 1. Copyright Gotsman, Elber, Barequet, Karni, Sheffer Computer Science - Technion. An Example.

Image Processing and Computer Graphics. Rendering Pipeline. Matthias Teschner. Computer Science Department University of Freiburg

COMP175: Computer Graphics. Lecture 1 Introduction and Display Technologies

Number Sense and Operations

Constrained Tetrahedral Mesh Generation of Human Organs on Segmented Volume *

MENSURATION. Definition

3D Distance from a Point to a Triangle

Area of Parallelograms, Triangles, and Trapezoids (pages )

CHAPTER 8, GEOMETRY. 4. A circular cylinder has a circumference of 33 in. Use 22 as the approximate value of π and find the radius of this cylinder.

Computer Graphics. Anders Hast

Biggar High School Mathematics Department. National 5 Learning Intentions & Success Criteria: Assessing My Progress

ME 111: Engineering Drawing

VALLIAMMAI ENGNIEERING COLLEGE SRM Nagar, Kattankulathur

Graph Theory Lecture 3: Sum of Degrees Formulas, Planar Graphs, and Euler s Theorem Spring 2014 Morgan Schreffler Office: POT 902

How To Use Design Mentor

Curriculum Map by Block Geometry Mapping for Math Block Testing August 20 to August 24 Review concepts from previous grades.

3D Viewing. Chapter 7. Projections. 3D clipping. OpenGL viewing functions and clipping planes

Creating Your Own 3D Models

CS 4810 Introduction to Computer Graphics

Wednesday 15 January 2014 Morning Time: 2 hours

IT 386: 3D Modeling and Animation. Review Sheet. Notes from Professor Nersesian s IT 386: 3D Modeling and Animation course

Third Grade Shapes Up! Grade Level: Third Grade Written by: Jill Pisman, St. Mary s School East Moline, Illinois Length of Unit: Eight Lessons

Area of Parallelograms (pages )

MayaVi: A free tool for CFD data visualization

Computer Graphics AACHEN AACHEN AACHEN AACHEN. Public Perception of CG. Computer Graphics Research. Methodological Approaches

GEOMETRY CONCEPT MAP. Suggested Sequence:

CPIT-285 Computer Graphics

Volume visualization I Elvins

DISCOVERING 3D SHAPES

GRAFICA - A COMPUTER GRAPHICS TEACHING ASSISTANT. Andreas Savva, George Ioannou, Vasso Stylianou, and George Portides, University of Nicosia Cyprus

Tennessee Mathematics Standards Implementation. Grade Six Mathematics. Standard 1 Mathematical Processes

Off-line Model Simplification for Interactive Rigid Body Dynamics Simulations Satyandra K. Gupta University of Maryland, College Park


CS 4204 Computer Graphics

We can display an object on a monitor screen in three different computer-model forms: Wireframe model Surface Model Solid model

2.3 WINDOW-TO-VIEWPORT COORDINATE TRANSFORMATION

COMP-557: Fundamentals of Computer Graphics McGill University, Fall 2010

How To Create A Surface From Points On A Computer With A Marching Cube

Surface and Volumetric Data Rendering and Visualization

Warning! Construction Zone: Building Solids from Nets

Such As Statements, Kindergarten Grade 8

Basic controls of Rhinoceros 3D software

1. Kyle stacks 30 sheets of paper as shown to the right. Each sheet weighs about 5 g. How can you find the weight of the whole stack?

SOLIDS, NETS, AND CROSS SECTIONS

Faculty of Computer Science Computer Graphics Group. Final Diploma Examination

Dual Marching Cubes: Primal Contouring of Dual Grids

The Essentials of CAGD

Using 3D Computer Graphics Multimedia to Motivate Teachers Learning of Geometry and Pedagogy

SA B 1 p where is the slant height of the pyramid. V 1 3 Bh. 3D Solids Pyramids and Cones. Surface Area and Volume of a Pyramid

Self-Positioning Handheld 3D Scanner

Triangulation by Ear Clipping

COMPARISON OF TWO DIFFERENT SURFACES FOR 3D MODEL ABSTRACTION IN SUPPORT OF REMOTE SENSING SIMULATIONS BACKGROUND

NEW MEXICO Grade 6 MATHEMATICS STANDARDS

Graphics Input Primitives. 5. Input Devices Introduction to OpenGL. String Choice/Selection Valuator

Pennsylvania System of School Assessment

Introduction to Computer Graphics. Reading: Angel ch.1 or Hill Ch1.

Vector storage and access; algorithms in GIS. This is lecture 6

Triangle Scan Conversion using 2D Homogeneous Coordinates

Sum of Degrees of Vertices Theorem

Shortest Path Algorithms

Line Segments, Rays, and Lines

NURBS Drawing Week 5, Lecture 10

Solving Simultaneous Equations and Matrices

EVERY DAY COUNTS CALENDAR MATH 2005 correlated to

Solids. Objective A: Volume of a Solids

Final Review Geometry A Fall Semester

3D Modelling in Blender Based on Polygonal Data

Intersection of a Line and a Convex. Hull of Points Cloud

How To Draw In Autocad

JavaFX 3D Animation: Bringing Duke to Life

Grade 7 & 8 Math Circles Circles, Circles, Circles March 19/20, 2013

Advanced Visualization for Chemistry

Transcription:

CS 543: Computer Graphics Lecture 5: 3D Modeling: Polygonal Meshes Emmanuel Agu

3D Modeling Previously Introduced 3D modeling Previously introduced GLUT models (wireframe/solid) and Scene Description Language (SDL): 3D file format Previously used GLUT calls Cylinder: glutwirecylinder( ), glutsolidcylinder( ) Cone: glutwirecone( ), glutsolidcone( ) Sphere: glutwiresphere( ), glutsolidsphere( ) Cube: glutwirecube( ), glutsolidcube( ) Newell Teapot, torus, etc

Polygonal Meshes Modeling with basic shapes (cube, cylinder, sphere, etc) too primitive Difficult to approach realism Polygonal meshes: Collection of polygons, or faces, that form skin of object Offer more flexibility Models complex surfaces better Examples: Human face Animal structures Furniture, etc

Polygonal Meshes Have become standard in CG OpenGL Good at drawing polygon Mesh = sequence of polygons Simple meshes exact. (e.g barn) Complex meshes approximate (e.g. human face) Later: use shading technique to smoothen

Non-solid Objects Examples: box, face Visualize as infinitely thin skin Meshes to approximate complex objects Shading used later to smoothen Non-trivial: creating mesh for complex objects (CAD)

What is a Polygonal Mesh Polygonal mesh given by: Polygon list Direction of each polygon Represent direction as normal vector Normal vector used in shading Normal vector/light vector determines shading

Vertex Normal Use vertex normal instead of face normal See advantages later: Facilitates clipping Shading of smoothly curved shapes Flat surfaces: all vertices associated with same n Smoothly curved surfaces: V1, V2 with common edge share n

Defining Polygonal Mesh Use barn example below:

Defining Polygonal Mesh Three lists: Vertex list: distinct vertices (vertex number, Vx, Vy, Vz) Normal list: Normals to faces (normalized nx, ny, nz) Face list: indexes into vertex and normal lists. i.e. vertices and normals associated with each face Face list convention: Traverse vertices counter-clockwise Interior on left, exterior on right

Newell Method for Normal Vectors Martin Newell at Utah (teapot guy) Normal vector: calculation difficult by hand Given formulae, suitable for computer Compute during mesh generation Simple approach used previously: Start with any three vertices V1, V2, V3 Form two vectors, say V1-V2, V3-V2 Normal: cross product (perp) of vectors

Newell Method for Normal Vectors Problems with simple approach: If two vectors are almost parallel, cross product is small Numerical inaccuracy may result Newell method: robust Formulae: Normal N = (mx, my, mz) x N 1 = i= 0 ( y y )( z z ) m + y N 1 = i= 0 i next( i) i next( i) ( z z )( x x ) m + z N 1 i= 0 i next( i) i next( i) ( x x )( y y ) m = + i next( i) i next( i)

Newell Method Example Example: Find normal of polygon with vertices P0 = (6,1,4), P1=(7,0,9) and P2 = (1,1,2) Solution: Using simple cross product: ((7,0,9)-(6,1,4)) X ((1,1,2)-(6,1,4)) = (2,-23,-5) Using Newell method, plug in values result is the same: Normal is (2, -23, -5)

Meshes in Programs Class Mesh Helper classes VertexID Face Mesh Object: Normal list Vertex list Face list Use arrays of pt, norm, face Dynamic allocation at runtime Array lengths: numverts, numnormals, numfaces

Meshes in Programs Face: Vertex list Normal vector associated with each face Array of index pairs Example, vth vertex of fth face: Position: pt[face[f].vert[v].vertindex] Normal vector: norm[face[f].vert[v].normindex] Organized approach, permits random access

Meshes in Programs Tetrahedron example

Meshes in Programs Data structure: // ############### Vertex ID ###################### class VertexID public: int vertindex; // index of this vertex in the vertex list int normindex; // index of this vertex s normal } // ############### Face ###################### class Face public: int nverts; // number of vertices in this face VertexID *vert; // the list of vertex and normal indices Face( ){nverts = 0; vert = NULL;} // constructor -Face( ){delete[ ] vert; nverts = 0; // destructor };

Meshes in Programs // ############### Mesh ###################### class Mesh{ private: int numverts; // number of vertices in the mesh Point3 *pt; // array of 3D vertices int numnormals; // number of normal vertices for the mesh } Vector3 *norm; // array of normals int numfaces; // number of faces in the mesh Face *face; // array of face data // others to be added later public: Mesh( ); // constructor ~Mesh( ); // destructor int readfile(char *filename); // to read in a filed mesh.. other methods.

Drawing Meshes Using OpenGL Pseudo-code: for(each face f in Mesh) { glbegin(gl_polygon); for(each vertex v in face f) { } glnormal3f(normal at vertex v); glvertex3f(position of vertex v); } glend( );

Drawing Meshes Using OpenGL Actual code: Void Mesh::draw( ) // use opengl to draw this mesh { for(int f = 0;f < numfaces;f++) { glbegin(gl_polygon); } } for(int v=0;v<face[f].nverts;v++) // for each one { int in = face[f].vert[v].normindex; // index of this normal int iv = face[f].vert[v].vertindex; // index of this vertex glnormal3f(norm[in].x, norm[in].y, norm[in].z); glvertex3f(pt[iv].x, pt[iv].y, pt[iv].z); } glend( );

Drawing Meshes Using SDL Scene class reads SDL files Accepts keyword Mesh Example: Pawn stored in mesh file pawn.3vn Add line: Push translate 3 5 4 scale 3 3 3 mesh pawn.3vn pop

Creating Meshes Simple meshes easy by hand Complex meshes: Mathematical functions Algorithms Digitize real objects Libraries of meshes available Mesh trends: 3D scanning Mesh Simplification

3D Simplification Example Original: 424,000 triangles 60,000 triangles (14%). 1000 triangles (0.2%) (courtesy of Michael Garland and Data courtesy of Iris Development.)

References Hill, 6.1-6.2