Building Models. Objectives. Introduce simple data structures for building polygonal models. OpenGL vertex arrays. Vertex lists Edge lists

Size: px
Start display at page:

Download "Building Models. Objectives. Introduce simple data structures for building polygonal models. OpenGL vertex arrays. Vertex lists Edge lists"

Transcription

1 Building Models Objectives Introduce simple data structures for building polygonal models Vertex lists Edge lists OpenGL vertex arrays 2

2 Representing a Mesh Consider a mesh v 5 v e e e 3 v v e 4 e v e v 7 7 e v e 2 2 e 2 e 0 e 4 e 5 v 3 8 nodes and 2 edges 5 interior polygons interior (shared) edges Each vertex has location v i = (x i y i z i ) 3 Simple Representation Define each polygon by geometric locations of vertices Leads to OpenGL code such as glbegin(gl_polygon); glvertex3f(x, y, z); glvertex3f(x, y, z); glvertex3f(x7, y7, z7); glend(); Inefficient and unstructured Consider moving vertex to new location Must search for all occurrences 4 2

3 Inward and Outward Facing Polygons Order {v, v, v 7 } and {v, v 7, v } equivalent ==> same polygon rendered by OpenGL but {v, v 7, v } different First two ==> outwardly facing polygons Use right-hand rule = counter-clockwise encirclement of outward-pointing normal OpenGL can treat inward and outward facing polygons differently 5 Geometry vs Topology Good idea to look for data structures that separate geometry from topology 3

4 Geometry vs Topology Good idea to look for data structures that separate geometry from topology Geometry: locations of vertices Topology: organization of vertices and edges Example: polygon = ordered list of vertices edge connecting successive pairs of vertices last to first Topology holds even if geometry changes 7 Vertex Lists Put geometry in array Use pointers from vertices into this array Introduce polygon list P P2 P3 P4 P5 topology v v 7 v v 8 v 5 v geometry x y z x 2 y 2 z 2 x 3 y 3 z 3 x 4 y 4 z 4 x 5 y 5 z 5. x y z x 7 y 7 z 7 x 8 y 8 z 8 8 4

5 Shared Edges Vertex lists will draw filled polygons correctly but if draw polygon by its edges ==> shared edges drawn twice Can store mesh by edge list 9 Edge List e e2 e3 e4 e5 e e7 e8 e9 v v x y z x 2 y 2 z 2 x 3 y 3 z 3 x 4 y 4 z 4 x 5 y 5 z 5. x y z x 7 y 7 z 7 x 8 y 8 z 8 v v 8 v 5 e e 8 e 3 e v e v 7 7 e v e 2 2 e 2 e 9 e 5 e 0 Note polygons are not represented v 3 e 4 0 5

6 Modeling a Cube Model color cube for rotating cube program Define global arrays for vertices and colors GLfloat vertices[][3] = {{-.0,-.0,-.0},{.0,-.0,-.0}, {.0,.0,-.0}, {-.0,.0,-.0}, {-.0,-.0,.0}, {.0,-.0,.0}, {.0,.0,.0}, {-.0,.0,.0}}; GLfloat colors[][3] = {{0.0,0.0,0.0},{.0,0.0,0.0}, {.0,.0,0.0}, {0.0,.0,0.0}, {0.0,0.0,.0}, {.0,0.0,.0}, {.0,.0,.0}, {0.0,.0,.0}}; Drawing a polygon from a list of indices Draw quadrilateral from list of indices into array vertices and use color corresponding to first index void polygon(int a, int b, int c, int d) { glbegin(gl_polygon); glcolor3fv(colors[a]); glvertex3fv(vertices[a]); glvertex3fv(vertices[b]); glvertex3fv(vertices[c]); glvertex3fv(vertices[d]); glend(); } 2

7 Draw cube from faces void colorcube( ) { polygon(0,3,2,); polygon(2,3,7,); polygon(0,4,7,3); polygon(,2,,5); polygon(4,5,,7); polygon(0,,5,4); } Note that vertices are ordered so that obtain correct outward facing normals 3 Efficiency Weakness of approach: building model in application ==> many function calls to draw cube Drawing cube by its faces in most straightforward way requires glbegin, glend glcolor 24 glvertex More if use texture and lighting 4 7

8 Vertex Arrays OpenGL provides facility called vertex arrays ==> allows to store array data in implementation Six types of arrays supported Vertices Colors Color indices Normals Texture coordinates Edge flags Will need only colors and vertices 5 Initialization Using same color and vertex data, first enable glenableclientstate(gl_color_array); glenableclientstate(gl_vertex_array); Identify location of arrays glvertexpointer(3, GL_FLOAT, 0, vertices); 3d arrays data array stored as floats data contiguous glcolorpointer(3, GL_FLOAT, 0, colors); 8

9 Mapping indices to faces Form array of face indices GLubyte cubeindices[24] = {0,3,2,,2,3,7, 0,4,7,3,,2,,5,4,5,,7,0,,5,4}; Each successive four indices describe face of cube Draw through gldrawelements ==> replaces all glvertex and glcolor calls in display callback 7 Drawing the cube Method : what to draw number of indices for(i=0; i<; i++) gldrawelements(gl_polygon, 4, GL_UNSIGNED_BYTE, &cubeindices[4*i]); format of index data Method 2: start of index data gldrawelements(gl_quads, 24, GL_UNSIGNED_BYTE, cubeindices); Draws cube with function call!! 8 9

Building Models. Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico

Building Models. Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico Building Models Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico 1 Objectives Introduce simple data structures for building polygonal

More information

Display Lists. Conceptually similar to a graphics file. In client-server environment, display list is placed on server

Display Lists. Conceptually similar to a graphics file. In client-server environment, display list is placed on server Display Lists Conceptually similar to a graphics file Must define (name, create) Add contents Close In client-server environment, display list is placed on server Can be redisplayed without sending primitives

More information

Building Models. Objectives Introduce simple data structures for building polygonal models. Vertex lists Edge lists

Building Models. Objectives Introduce simple data structures for building polygonal models. Vertex lists Edge lists Building Models Objectives Introduce simple data structures for building polygonal models Vertex lists Edge lists 1 Representing a Mesh Consider a mesh v 5 v 6 e e e 3 v 9 8 8 v e 4 1 e 11 v e v 7 7 1

More information

GEOMETRIC OBJECTS AND TRANSFORMATIONS I

GEOMETRIC OBJECTS AND TRANSFORMATIONS I Computer UNIT Graphics - 4 and Visualization 6 Hrs GEOMETRIC OBJECTS AND TRANSFORMATIONS I Scalars Points, and vectors Three-dimensional primitives Coordinate systems and frames Modelling a colored cube

More information

Building Models. Prof. George Wolberg Dept. of Computer Science City College of New York

Building Models. Prof. George Wolberg Dept. of Computer Science City College of New York Building Models Prof. George Wolberg Dept. of Computer Science City College of New York Objectives Introduce simple data structures for building polygonal models - Vertex lists - Edge lists Deprecated

More information

UNIT 4 GEOMETRIC OBJECTS AND TRANSFORMATIONS-1

UNIT 4 GEOMETRIC OBJECTS AND TRANSFORMATIONS-1 UNIT 4 GEOMETRIC OBJECTS AND TRANSFORMATIONS-1 1. Explain the complete procedure of converting a world object frame into camera or eye frame, using the model view matrix. (Jun2012) 10M Ans: World Space

More information

Graphics Output Primitives Hearn & Baker Chapter 3. Some slides are taken from Robert Thomsons notes.

Graphics Output Primitives Hearn & Baker Chapter 3. Some slides are taken from Robert Thomsons notes. Graphics Output Primitives Hearn & Baker Chapter 3 Some slides are taken from Robert Thomsons notes. OVERVIEW Coordinate reference frames OpenGL Point & Line functions Line drawing algorithms Curve drawing

More information

Building Models. CS 537 Interactive Computer Graphics Prof. David E. Breen Department of Computer Science

Building Models. CS 537 Interactive Computer Graphics Prof. David E. Breen Department of Computer Science Building Models CS 537 Interactive Computer Graphics Prof. David E. Breen Department of Computer Science 1 Objectives Introduce simple data structures for building polygonal models - Vertex lists - Edge

More information

CS452/552; EE465/505. Models & Viewing

CS452/552; EE465/505. Models & Viewing CS452/552; EE465/505 Models & Viewing 2-03 15 Outline! Building Polygonal Models Vertex lists; gl.drawarrays( ) Edge lists: gl.drawelements( )! Viewing Classical Viewing Read: Viewing in Web3D Angel, Section

More information

PESIT Bangalore South Campus Hosur road, 1km before Electronic City, Bengaluru -100 Department of Computer Science

PESIT Bangalore South Campus Hosur road, 1km before Electronic City, Bengaluru -100 Department of Computer Science INTERNAL ASSESSMENT TEST 2 Solution Date : 30.03.15 Max Marks : 50 Subject & Code : Computer Graphics and Visualization/10CS65 Section : A, B and C Name of faculty : Ms. Sarasvathi V/ Ms. Archana Time

More information

OpenGL. Jimmy Johansson Norrköping Visualization and Interaction Studio Linköping University

OpenGL. Jimmy Johansson Norrköping Visualization and Interaction Studio Linköping University OpenGL Jimmy Johansson Norrköping Visualization and Interaction Studio Linköping University Background Software interface to graphics hardware 250+ commands Objects (models) are built from geometric primitives

More information

Computer Graphics. Prof. Feng Liu. Fall /14/2016

Computer Graphics. Prof. Feng Liu. Fall /14/2016 Computer Graphics Prof. Feng Liu Fall 2016 http://www.cs.pdx.edu/~fliu/courses/cs447/ 11/14/2016 Last time Texture Mapping 2 Mid-term 3 Today Mesh and Modeling 4 The Story So Far We ve looked at images

More information

Modeling. Simulating the Everyday World

Modeling. Simulating the Everyday World Modeling Simulating the Everyday World Three broad areas: Modeling (Geometric) = Shape Animation = Motion/Behavior Rendering = Appearance Page 1 Geometric Modeling 1. How to represent 3d shapes Polygonal

More information

CENG 477 Introduction to Computer Graphics. Graphics Hardware and OpenGL

CENG 477 Introduction to Computer Graphics. Graphics Hardware and OpenGL CENG 477 Introduction to Computer Graphics Graphics Hardware and OpenGL Introduction Until now, we focused on graphic algorithms rather than hardware and implementation details But graphics, without using

More information

Filled Area Primitives. CEng 477 Introduction to Computer Graphics METU, 2007

Filled Area Primitives. CEng 477 Introduction to Computer Graphics METU, 2007 Filled Area Primitives CEng 477 Introduction to Computer Graphics METU, 2007 Filled Area Primitives Two basic approaches to area filling on raster systems: Determine the overlap intervals for scan lines

More information

Computer Graphics CS 543 Lecture 4 (Part 2) Building 3D Models (Part 2)

Computer Graphics CS 543 Lecture 4 (Part 2) Building 3D Models (Part 2) Computer Graphics CS 543 Lecture 4 (Part 2) Building 3D Models (Part 2) Prof Emmanuel Agu Computer Science Dept. Worcester Polytechnic Institute (WPI) Modeling a Cube In 3D, declare vertices as (x,y,z)

More information

CSE528 Computer Graphics: Theory, Algorithms, and Applications

CSE528 Computer Graphics: Theory, Algorithms, and Applications CSE528 Computer Graphics: Theory, Algorithms, and Applications Hong Qin State University of New York at Stony Brook (Stony Brook University) Stony Brook, New York 11794--4400 Tel: (631)632-8450; Fax: (631)632-8334

More information

Interaction Computer Graphics I Lecture 3

Interaction Computer Graphics I Lecture 3 15-462 Computer Graphics I Lecture 3 Interaction Client/Server Model Callbacks Double Buffering Hidden Surface Removal Simple Transformations January 21, 2003 [Angel Ch. 3] Frank Pfenning Carnegie Mellon

More information

SOURCES AND URLS BIBLIOGRAPHY AND REFERENCES

SOURCES AND URLS BIBLIOGRAPHY AND REFERENCES In this article, we have focussed on introducing the basic features of the OpenGL API. At this point, armed with a handful of OpenGL functions, you should be able to write some serious applications. In

More information

Interaction. CSCI 480 Computer Graphics Lecture 3

Interaction. CSCI 480 Computer Graphics Lecture 3 CSCI 480 Computer Graphics Lecture 3 Interaction January 18, 2012 Jernej Barbic University of Southern California Client/Server Model Callbacks Double Buffering Hidden Surface Removal Simple Transformations

More information

Polygonal Models. Overview. Simple Data Structures. David Carr Fundamentals of Computer Graphics Spring 2004 Based on Slides by E.

Polygonal Models. Overview. Simple Data Structures. David Carr Fundamentals of Computer Graphics Spring 2004 Based on Slides by E. INSTITUTIONEN FÖR SYSTEMTEKNIK LULEÅ TEKNISKA UNIVERSITET Polygonal Modls David Carr Fundamntals of Computr Graphics Spring 200 Basd on Slids by E. Angl Fb-3-0 SMD159, Polygonal Modls 1 L Ovrviw Simpl

More information

CS559: Computer Graphics. Lecture 23: Shape Modeling Li Zhang Spring 2010

CS559: Computer Graphics. Lecture 23: Shape Modeling Li Zhang Spring 2010 CS559: Computer Graphics Lecture 23: Shape Modeling Li Zhang Spring 2010 Shape model You have some experience with shape modeling Rails as curves Tree = cone + cylinder There are many ways to represent

More information

Graphics Programming. August 31, Programming of the Sierpinski gasket. Programming with OpenGL and C/C++

Graphics Programming. August 31, Programming of the Sierpinski gasket. Programming with OpenGL and C/C++ Computer Graphics Graphics Programming August 31, 2005 Contents Our Goal in This Chapter Programming of the Sierpinski gasket How To? Programming with OpenGL and C/C++ OpenGL API (Application Programmer

More information

2D Drawing Primitives

2D Drawing Primitives THE SIERPINSKI GASKET We use as a sample problem the drawing of the Sierpinski gasket an interesting shape that has a long history and is of interest in areas such as fractal geometry. The Sierpinski gasket

More information

Today s Agenda. Basic design of a graphics system. Introduction to OpenGL

Today s Agenda. Basic design of a graphics system. Introduction to OpenGL Today s Agenda Basic design of a graphics system Introduction to OpenGL Image Compositing Compositing one image over another is most common choice can think of each image drawn on a transparent plastic

More information

Vertex Buffer Objects

Vertex Buffer Objects 1 Vertex Buffer Objects This work is licensed under a Creative Commons Attribution-NonCommercial- NoDerivatives 4.0 International License Mike Bailey mjb@cs.oregonstate.edu VertexBuffers.pptx Vertex Buffer

More information

Vertex Buffer Objects. Vertex Buffer Objects: The Big Idea

Vertex Buffer Objects. Vertex Buffer Objects: The Big Idea 1 Vertex Buffer Objects This work is licensed under a Creative Commons Attribution-NonCommercial- NoDerivatives 4.0 International License Mike Bailey mjb@cs.oregonstate.edu VertexBuffers.pptx Vertex Buffer

More information

Lectures Display List

Lectures Display List Lectures Display List By Tom Duff Pixar Animation Studios Emeryville, California and George Ledin Jr Sonoma State University Rohnert Park, California 2004, Tom Duff and George Ledin Jr 1 What is it? What

More information

Programming with OpenGL Part 3: Three Dimensions

Programming with OpenGL Part 3: Three Dimensions Programming with OpenGL Part 3: Three Dimensions Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico Objectives Develop a more sophisticated

More information

Exercise 1 Introduction to OpenGL

Exercise 1 Introduction to OpenGL Exercise 1 Introduction to OpenGL What we are going to do OpenGL Glut Small Example using OpenGl and Glut Alexandra Junghans 2 What is OpenGL? OpenGL Two Parts most widely used and supported graphics API

More information

Teacher Assistant : Tamir Grossinger Reception hours: by - Building 37 / office -102 Assignments: 4 programing using

Teacher Assistant : Tamir Grossinger   Reception hours: by  - Building 37 / office -102 Assignments: 4 programing using Teacher Assistant : Tamir Grossinger email: tamirgr@gmail.com Reception hours: by email - Building 37 / office -102 Assignments: 4 programing using C++ 1 theoretical You can find everything you need in

More information

Meshing and Geometry

Meshing and Geometry Meshing and Geometry Points in OpenGL glbegin(gl_points); glvertex2fv(p0); glvertex2fv(p1); p7 p0 p1 glvertex2fv(p2); glvertex2fv(p3); p6 p2 glvertex2fv(p4); glvertex2fv(p5); p5 p3 glvertex2fv(p6); glvertex2fv(p7);

More information

CS193P - Lecture 19. iphone Application Development. OpenGL ES

CS193P - Lecture 19. iphone Application Development. OpenGL ES CS193P - Lecture 19 iphone Application Development OpenGL ES 1 Announcements Final projects due in 7 days Tuesday, March 16th 11:59 pm Submit: Code Power-point/Keynote slides ReadMe file Final project

More information

Homework #2 and #3 Due Friday, October 12 th and Friday, October 19 th

Homework #2 and #3 Due Friday, October 12 th and Friday, October 19 th Homework #2 and #3 Due Friday, October 12 th and Friday, October 19 th 1. a. Show that the following sequences commute: i. A rotation and a uniform scaling ii. Two rotations about the same axis iii. Two

More information

Computer Graphics and Visualization SYLLABUS COMPUTER GRAPHICS AND VISUALIZATION

Computer Graphics and Visualization SYLLABUS COMPUTER GRAPHICS AND VISUALIZATION SYLLABUS COMPUTER GRAPHICS AND VISUALIZATION Subject Code: I.A. Marks : 25 Hours/Week : 04 Exam Hours: 03 Total Hours : 52 Exam Marks: 100 PART - A UNIT - 1 INTRODUCTION: Applications of computer graphics;

More information

Building Models. Angel and Shreiner: Interactive Computer Graphics 7E Addison-Wesley 2015

Building Models. Angel and Shreiner: Interactive Computer Graphics 7E Addison-Wesley 2015 Building Models 1 Objectives Introduce simple data structures for building polygonal models Vertex lists Edge lists 2 Representing a Mesh Consider a mesh v 5 v 6 e e e 3 v 9 8 8 v e 4 1 e 11 e v v 7 7

More information

Lecture 3 Advanced Computer Graphics (CS & SE )

Lecture 3 Advanced Computer Graphics (CS & SE ) Lecture 3 Advanced Computer Graphics (CS & SE 233.420) Programming with OpenGL Program Structure Primitives Attributes and States Programming in three dimensions Inputs and Interaction Working with Callbacks

More information

Computer Graphics (CS 543) Lecture 4a: Linear Algebra for Graphics (Points, Scalars, Vectors)

Computer Graphics (CS 543) Lecture 4a: Linear Algebra for Graphics (Points, Scalars, Vectors) Computer Graphics (CS 543) Lecture 4a: Linear Algebra for Graphics (Points, Scalars, Vectors) Prof Emmanuel Agu Computer Science Dept. Worcester Polytechnic Institute (WPI) Announcements Sample exam 1

More information

CSCI E-74. Simulation and Gaming

CSCI E-74. Simulation and Gaming CSCI E-74 Virtual and Augmented Reality for Simulation and Gaming Fall term 2017 Gianluca De Novi, PhD Lesson 3 General Introduction to OpenGL APIs and TRS Perspective Simulation Perspective simulation

More information

Programming of Graphics

Programming of Graphics Peter Mileff PhD Programming of Graphics Introduction to OpenGL University of Miskolc Department of Information Technology OpenGL libraries GL (Graphics Library): Library of 2D, 3D drawing primitives and

More information

Lecture 2 2D transformations Introduction to OpenGL

Lecture 2 2D transformations Introduction to OpenGL Lecture 2 2D transformations Introduction to OpenGL OpenGL where it fits what it contains how you work with it OpenGL parts: GL = Graphics Library (core lib) GLU = GL Utilities (always present) GLX, AGL,

More information

How shapes are represented in 3D Graphics. Aims and objectives By the end of the lecture you will be able to describe

How shapes are represented in 3D Graphics. Aims and objectives By the end of the lecture you will be able to describe Today s lecture Today we will learn about The mathematics of 3D space vectors How shapes are represented in 3D Graphics Modelling shapes as polygons Aims and objectives By the end of the lecture you will

More information

COMPUTER GRAPHICS AND VISUALIZATION. Subject Code: 10CS65 / 10IS665 I.A. Marks : 25 Hours/Week : 04 Exam Hours: 03 Total Hours : 52 Exam Marks: 100

COMPUTER GRAPHICS AND VISUALIZATION. Subject Code: 10CS65 / 10IS665 I.A. Marks : 25 Hours/Week : 04 Exam Hours: 03 Total Hours : 52 Exam Marks: 100 COMPUTER GRAPHICS AND VISUALIZATION Subject Code: 10CS65 / 10IS665 I.A. Marks : 25 Hours/Week : 04 Exam Hours: 03 Total Hours : 52 Exam Marks: 100 PART - A UNIT 1 7 Hours Introduction: Applications of

More information

3 Meshes. Strips, Fans, Indexed Face Sets. Display Lists, Vertex Buffer Objects, Vertex Cache

3 Meshes. Strips, Fans, Indexed Face Sets. Display Lists, Vertex Buffer Objects, Vertex Cache 3 Meshes Strips, Fans, Indexed Face Sets Display Lists, Vertex Buffer Objects, Vertex Cache Intro generate geometry triangles, lines, points glbegin(mode) starts primitive then stream of vertices with

More information

How OpenGL Works. Retained Mode. Immediate Mode. Introduction To OpenGL

How OpenGL Works. Retained Mode. Immediate Mode. Introduction To OpenGL How OpenGL Works Introduction To OpenGL OpenGL uses a series of matrices to control the position and way primitives are drawn OpenGL 1.x - 2.x allows these primitives to be drawn in two ways immediate

More information

EECE 478. Learning Objectives. Learning Objectives. Rasterization & Scenes. Rasterization. Compositing

EECE 478. Learning Objectives. Learning Objectives. Rasterization & Scenes. Rasterization. Compositing EECE 478 Rasterization & Scenes Rasterization Learning Objectives Be able to describe the complete graphics pipeline. Describe the process of rasterization for triangles and lines. Compositing Manipulate

More information

Lecture 3. Understanding of OPenGL programming

Lecture 3. Understanding of OPenGL programming Lecture 3 Understanding of OPenGL programming What is OpenGL GL: stands for Graphic Library Software interface for rendering purposes for 2D or 3D geometric data objects. Various Pieces gl: The basic libraries.

More information

Computer graphics MN1

Computer graphics MN1 Computer graphics MN1 http://www.opengl.org Todays lecture What is OpenGL? How do I use it? Rendering pipeline Points, vertices, lines,, polygons Matrices and transformations Lighting and shading Code

More information

Computer Graphics (Basic OpenGL)

Computer Graphics (Basic OpenGL) Computer Graphics (Basic OpenGL) Thilo Kielmann Fall 2008 Vrije Universiteit, Amsterdam kielmann@cs.vu.nl http://www.cs.vu.nl/ graphics/ Computer Graphics (Basic OpenGL, Input and Interaction), ((57))

More information

三維繪圖程式設計 3D Graphics Programming Design 第三章三維繪圖狀態設定和幾何元件繪製嘉大資工系盧天麒

三維繪圖程式設計 3D Graphics Programming Design 第三章三維繪圖狀態設定和幾何元件繪製嘉大資工系盧天麒 三維繪圖程式設計 3D Graphics Programming Design 第三章三維繪圖狀態設定和幾何元件繪製嘉大資工系盧天麒 1 In this chapter, you will learn How to access values in the OpenGL state machine The types of primitives available in OpenGL How to

More information

Computer Graphics Course 2005

Computer Graphics Course 2005 Computer Graphics Course 2005 Introduction to GLUT, GLU and OpenGL Administrative Stuff Teaching Assistant: Rony Goldenthal Reception Hour: Wed. 18:00 19:00 Room 31 (Ross 1) Questions: E-mail: cg@cs Newsgroups:

More information

Computer Graphics. This Week. Meshes. Meshes. What is a Polygon Mesh? Meshes. Modelling Shapes with Polygon Meshes.

Computer Graphics. This Week. Meshes. Meshes. What is a Polygon Mesh? Meshes. Modelling Shapes with Polygon Meshes. 1 This Week Computer Graphics Modeling Shapes Modelling Shapes with Polygon Solid Modelling Extruded Shapes Mesh Approximations 2 What is a Polygon Mesh? A surface made up of a collection of polygon faces.

More information

Parametric description

Parametric description Examples: surface of revolution Vase Torus Parametric description Parameterization for a subdivision curve Modeling Polygonal meshes Graphics I Faces Face based objects: Polygonal meshes OpenGL is based

More information

API Background. Prof. George Wolberg Dept. of Computer Science City College of New York

API Background. Prof. George Wolberg Dept. of Computer Science City College of New York API Background Prof. George Wolberg Dept. of Computer Science City College of New York Objectives Graphics API history OpenGL API OpenGL function format Immediate Mode vs Retained Mode Examples The Programmer

More information

Introduction to Computer Graphics with OpenGL/GLUT

Introduction to Computer Graphics with OpenGL/GLUT Introduction to Computer Graphics with OpenGL/GLUT What is OpenGL? A software interface to graphics hardware Graphics rendering API (Low Level) High-quality color images composed of geometric and image

More information

Yazhuo Liu Homework 3

Yazhuo Liu Homework 3 Yazhuo Liu Homework 3 Write a shader program that renders a colored tetrahedron, which gradually shrinks to a point and expands back to its original shape. While it is shrinking and expanding, the color

More information

4: Polygons and pixels

4: Polygons and pixels COMP711 Computer Graphics and Image Processing 4: Polygons and pixels Toby.Howard@manchester.ac.uk 1 Introduction We ll look at Properties of polygons: convexity, winding, faces, normals Scan conversion

More information

Computer Graphics and Visualization. Graphics Systems and Models

Computer Graphics and Visualization. Graphics Systems and Models UNIT -1 Graphics Systems and Models 1.1 Applications of computer graphics: Display Of Information Design Simulation & Animation User Interfaces 1.2 Graphics systems A Graphics system has 5 main elements:

More information

OpenGL Texture Mapping. Objectives Introduce the OpenGL texture functions and options

OpenGL Texture Mapping. Objectives Introduce the OpenGL texture functions and options OpenGL Texture Mapping Objectives Introduce the OpenGL texture functions and options 1 Basic Strategy Three steps to applying a texture 1. 2. 3. specify the texture read or generate image assign to texture

More information

Polygonal Meshes: Representing 3D Objects

Polygonal Meshes: Representing 3D Objects Polygonal Meshes: Representing 3D Objects Real world modeling requires representation of surfaces Two situations: 1. Model an existing object Most likely can only approximate the object Represent all (most)

More information

Lecture 2 CISC440/640 Spring Department of Computer and Information Science

Lecture 2 CISC440/640 Spring Department of Computer and Information Science Lecture 2 CISC440/640 Spring 2015 Department of Computer and Information Science Today s Topic The secrets of Glut-tony 2 So let s do some graphics! For the next week or so this is your world: -1 1-1 1

More information

CSCI 4620/8626. Computer Graphics Attributes of Graphics Primitives (Chapter 5)

CSCI 4620/8626. Computer Graphics Attributes of Graphics Primitives (Chapter 5) CSCI 4620/8626 Computer Graphics Attributes of Graphics Primitives (Chapter 5) Last update: 2015-03-02 Non-Fill Methods While polygons can be filled (with patterns or colors), they can also be displayed

More information

polygon meshes polygon meshes representation

polygon meshes polygon meshes representation polygon meshes computer graphics polygon meshes 2009 fabio pellacini 1 polygon meshes representation which representation is good? often triangles/quads only will work on triangles compact efficient for

More information

RECITATION - 1. Ceng477 Fall

RECITATION - 1. Ceng477 Fall RECITATION - 1 Ceng477 Fall 2007-2008 2/ 53 Agenda General rules for the course General info on the libraries GLUT OpenGL GLUI Details about GLUT Functions Probably we will not cover this part 3/ 53 General

More information

A display list is a group of OpenGL commands that have been stored for later execution.

A display list is a group of OpenGL commands that have been stored for later execution. Introduction A display list is a group of OpenGL commands that have been stored for later execution. Most OpenGL commands can be either stored in a display list or issued in immediate mode. 1 For example,

More information

Computer Graphics. Bing-Yu Chen National Taiwan University

Computer Graphics. Bing-Yu Chen National Taiwan University Computer Graphics Bing-Yu Chen National Taiwan University Introduction to OpenGL General OpenGL Introduction An Example OpenGL Program Drawing with OpenGL Transformations Animation and Depth Buffering

More information

Lectures OpenGL Introduction

Lectures OpenGL Introduction Lectures OpenGL Introduction By Tom Duff Pixar Animation Studios Emeryville, California and George Ledin Jr Sonoma State University Rohnert Park, California 2004, Tom Duff and George Ledin Jr 1 What is

More information

This Lecture. Why OpenGL? Introduction to OpenGL. Programmer s View

This Lecture. Why OpenGL? Introduction to OpenGL. Programmer s View Foundations of Computer Graphics Overview and Motivation This Lecture Introduction to OpenGL and simple demo code mytest1.cpp ; you compiled mytest3.cpp for HW 0 I am going to show (and write) actual code

More information

Early History of APIs. PHIGS and X. SGI and GL. Programming with OpenGL Part 1: Background. Objectives

Early History of APIs. PHIGS and X. SGI and GL. Programming with OpenGL Part 1: Background. Objectives Programming with OpenGL Part 1: Background Early History of APIs Objectives Development of the OpenGL API OpenGL Architecture - OpenGL as a state machine Functions - Types -Formats Simple program IFIPS

More information

ERKELEY DAVIS IRVINE LOS ANGELES RIVERSIDE SAN DIEGO SAN FRANCISCO EECS 104. Fundamentals of Computer Graphics. OpenGL

ERKELEY DAVIS IRVINE LOS ANGELES RIVERSIDE SAN DIEGO SAN FRANCISCO EECS 104. Fundamentals of Computer Graphics. OpenGL ERKELEY DAVIS IRVINE LOS ANGELES RIVERSIDE SAN DIEGO SAN FRANCISCO SANTA BARBARA SANTA CRUZ EECS 104 Fundamentals of Computer Graphics OpenGL Slides courtesy of Dave Shreine, Ed Angel and Vicki Shreiner

More information

The Application Stage. The Game Loop, Resource Management and Renderer Design

The Application Stage. The Game Loop, Resource Management and Renderer Design 1 The Application Stage The Game Loop, Resource Management and Renderer Design Application Stage Responsibilities 2 Set up the rendering pipeline Resource Management 3D meshes Textures etc. Prepare data

More information

Programming with OpenGL Part 1: Background

Programming with OpenGL Part 1: Background Programming with OpenGL Part 1: Background Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico 1 Objectives Development of the OpenGL API

More information

What is a tessellation???? Give an example... Daily Do from last class Homework Answers 10 7 These are similar: What does y =? x =?

What is a tessellation???? Give an example... Daily Do from last class Homework Answers 10 7 These are similar: What does y =? x =? Daily Do from last class Homework Answers 10 7 These are similar: What does y =? x =? 36 74 0 78 0 154 o 44 48 54 o y x 154 o 78 0 12 74 0 9 1. 8 ft 2. 21m 3. 21 ft 4. 30cm 5. 6mm 6. 16 in 7. yes 9 = 7

More information

CSCI 4620/8626. Primitives and Attributes

CSCI 4620/8626. Primitives and Attributes CSCI 4620/8626 Computer Graphics Attributes of Graphics Primitives (Chapter 5) Last update: 2016-02-23 Primitives and Attributes The graphics primitives we ve seen so far are fundamental shapes, like lines,

More information

Computer graphics MN1

Computer graphics MN1 Computer graphics MN1 Hierarchical modeling Transformations in OpenGL glmatrixmode(gl_modelview); glloadidentity(); // identity matrix gltranslatef(4.0, 5.0, 6.0); glrotatef(45.0, 1.0, 2.0, 3.0); gltranslatef(-4.0,

More information

6.837 Introduction to Computer Graphics Assignment 5: OpenGL and Solid Textures Due Wednesday October 22, 2003 at 11:59pm

6.837 Introduction to Computer Graphics Assignment 5: OpenGL and Solid Textures Due Wednesday October 22, 2003 at 11:59pm 6.837 Introduction to Computer Graphics Assignment 5: OpenGL and Solid Textures Due Wednesday October 22, 2003 at 11:59pm In this assignment, you will add an interactive preview of the scene and solid

More information

Rendering. Part 1 An introduction to OpenGL

Rendering. Part 1 An introduction to OpenGL Rendering Part 1 An introduction to OpenGL Olivier Gourmel VORTEX Team IRIT University of Toulouse gourmel@irit.fr Image synthesis The Graphics Processing Unit (GPU): A highly parallel architecture specialized

More information

Basic Graphics Programming

Basic Graphics Programming 15-462 Computer Graphics I Lecture 2 Basic Graphics Programming Graphics Pipeline OpenGL API Primitives: Lines, Polygons Attributes: Color Example January 17, 2002 [Angel Ch. 2] Frank Pfenning Carnegie

More information

Computer Graphics. OpenGL

Computer Graphics. OpenGL Computer Graphics OpenGL What is OpenGL? OpenGL (Open Graphics Library) is a library for computer graphics It consists of several procedures and functions that allow a programmer to specify the objects

More information

CS 543 Lecture 1 (Part 3) Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)

CS 543 Lecture 1 (Part 3) Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI) Computer Graphics CS 543 Lecture 1 (Part 3) Prof Emmanuel Agu Computer Science Dept. Worcester Polytechnic Institute (WPI) Recall: OpenGL Skeleton void main(int argc, char** argv){ // First initialize

More information

Computer graphics Labs: OpenGL (1/3) Geometric transformations and projections

Computer graphics Labs: OpenGL (1/3) Geometric transformations and projections University of Liège Department of Aerospace and Mechanical engineering Computer graphics Labs: OpenGL (1/3) Geometric transformations and projections Exercise 1: Geometric transformations (Folder transf

More information

Image Rendering. Rendering can be divided into three sub-problems. Image Formation The hidden surface problem visibility determination steps

Image Rendering. Rendering can be divided into three sub-problems. Image Formation The hidden surface problem visibility determination steps Image Rendering Rendering can be divided into three sub-problems Image Formation The hidden surface problem visibility determination steps Illumination Direct illumination Indirect illumination Shading

More information

CS 591B Lecture 9: The OpenGL Rendering Pipeline

CS 591B Lecture 9: The OpenGL Rendering Pipeline CS 591B Lecture 9: The OpenGL Rendering Pipeline 3D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination Spring 2007 Rui Wang 3D Polygon Rendering Many applications

More information

3D Graphics and OpenGl. First Steps

3D Graphics and OpenGl. First Steps 3D Graphics and OpenGl First Steps Rendering of 3D Graphics Objects defined in (virtual/mathematical) 3D space. Rendering of 3D Graphics Objects defined in (virtual/mathematical) 3D space. We see surfaces

More information

Assignment #2: 2D Vector Field Topological Analysis: Compute Differential Topology and Geometric-based Morse Decomposition

Assignment #2: 2D Vector Field Topological Analysis: Compute Differential Topology and Geometric-based Morse Decomposition Assignment #2: 2D Vector Field Topological Analysis: Compute Differential Topology and Geometric-based Morse Decomposition Goals: Due Mar 8 th, before midnight By completing the first assignment, you should

More information

QUESTION 1 [10] 2 COS340-A October/November 2009

QUESTION 1 [10] 2 COS340-A October/November 2009 2 COS340-A QUESTION 1 [10] a) OpenGL uses z-buffering for hidden surface removal. Explain how the z-buffer algorithm works and give one advantage of using this method. (5) Answer: OpenGL uses a hidden-surface

More information

Interacting with a 3D World

Interacting with a 3D World CS380: Computer Graphics Interacting with a 3D World Sung-Eui Yoon ( 윤성의 ) Course URL: http://sglab.kaist.ac.kr/~sungeui/cg/ Announcement Mid-term exam 12:40pm ~ 2:00pm, Mar-26 (Mon.) 2 Class Objectives

More information

Graphics. Texture Mapping 고려대학교컴퓨터그래픽스연구실.

Graphics. Texture Mapping 고려대학교컴퓨터그래픽스연구실. Graphics Texture Mapping 고려대학교컴퓨터그래픽스연구실 3D Rendering Pipeline 3D Primitives 3D Modeling Coordinates Model Transformation 3D World Coordinates Lighting 3D World Coordinates Viewing Transformation 3D Viewing

More information

Graphical Objects and Scene Graphs

Graphical Objects and Scene Graphs Graphical Objects and Scene Graphs Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico Objectives Introduce graphical objects Generalize

More information

5.2 Shading in OpenGL

5.2 Shading in OpenGL Fall 2017 CSCI 420: Computer Graphics 5.2 Shading in OpenGL Hao Li http://cs420.hao-li.com 1 Outline Normal Vectors in OpenGL Polygonal Shading Light Sources in OpenGL Material Properties in OpenGL Example:

More information

COMP 371/4 Computer Graphics Week 1

COMP 371/4 Computer Graphics Week 1 COMP 371/4 Computer Graphics Week 1 Course Overview Introduction to Computer Graphics: Definition, History, Graphics Pipeline, and Starting Your First OpenGL Program Ack: Slides from Prof. Fevens, Concordia

More information

We can use square dot paper to draw each view (top, front, and sides) of the three dimensional objects:

We can use square dot paper to draw each view (top, front, and sides) of the three dimensional objects: Unit Eight Geometry Name: 8.1 Sketching Views of Objects When a photo of an object is not available, the object may be drawn on triangular dot paper. This is called isometric paper. Isometric means equal

More information

To Do. Demo: Surreal (HW 3) This Lecture. Introduction to OpenGL. Outline. Foundations of Computer Graphics (Spring 2012)

To Do. Demo: Surreal (HW 3) This Lecture. Introduction to OpenGL. Outline. Foundations of Computer Graphics (Spring 2012) Foundations of Computer Graphics (Spring 2012) CS 184, Lecture 6: OpenGL 1 http://inst.eecs.berkeley.edu/~cs184 To Do HW 1 due on Thu Must find partners for HW 2 (if problems, speak to TAs during section).

More information

Methodology for Lecture

Methodology for Lecture Basic Geometry Setup Methodology for Lecture Make mytest1 more ambitious Sequence of steps Demo Review of Last Demo Changed floor to all white, added global for teapot and teapotloc, moved geometry to

More information

CSC Graphics Programming. Budditha Hettige Department of Statistics and Computer Science

CSC Graphics Programming. Budditha Hettige Department of Statistics and Computer Science CSC 307 1.0 Graphics Programming Department of Statistics and Computer Science Graphics Programming OpenGL 3D Drawing 2 3D Graphics Projections Getting 3D to 2D 3D scene 2D image 3 Projections Orthographic

More information

Display Lists in OpenGL

Display Lists in OpenGL Display Lists in OpenGL Display lists are a mechanism for improving performance of interactive OpenGL applications. A display list is a group of OpenGL commands that have been stored for later execution.

More information

Shading in OpenGL. Outline. Defining and Maintaining Normals. Normalization. Enabling Lighting and Lights. Outline

Shading in OpenGL. Outline. Defining and Maintaining Normals. Normalization. Enabling Lighting and Lights. Outline CSCI 420 Computer Graphics Lecture 10 Shading in OpenGL Normal Vectors in OpenGL Polygonal Shading Light Source in OpenGL Material Properties in OpenGL Approximating a Sphere [Angel Ch. 6.5-6.9] Jernej

More information

Textures. Texture Mapping. Bitmap Textures. Basic Texture Techniques

Textures. Texture Mapping. Bitmap Textures. Basic Texture Techniques Texture Mapping Textures The realism of an image is greatly enhanced by adding surface textures to the various faces of a mesh object. In part a) images have been pasted onto each face of a box. Part b)

More information

CS 465 Program 4: Modeller

CS 465 Program 4: Modeller CS 465 Program 4: Modeller out: 30 October 2004 due: 16 November 2004 1 Introduction In this assignment you will work on a simple 3D modelling system that uses simple primitives and curved surfaces organized

More information

Evaluators and Spline Surfaces

Evaluators and Spline Surfaces Evaluators and Spline Surfaces Prerequisites A modest understanding of parametric functions of two variables together with an understanding of modeling by stepping through the polygons in a surface with

More information