You are on page 1of 43

Computer Graphics

An Introduction

What s this course all about?
We will cover« Graphics programming and algorithms Graphics data structures Colour Applied geometry, modelling and rendering

13/02/2012

Lecture 1

2

What is Computer Graphics? (1/2)
‡ Definition
± Producing pictures or images using a computer

‡ Example
± Starship Troopers: Tango-Urilla, Death From Above
‡ The Final Stage: Burning the bugs

Courtesy of Tippet Studio
cgvr.korea.ac.kr 3

What is Computer Graphics? (1/2)
‡ Definition
± Producing pictures or images using a computer

‡ Example
± Starship Troopers: Tango-Urilla, Death From Above ± Batman & Robin: The Love Dust

Courtesy of Buf Compagnie
cgvr.korea.ac.kr 4

ac.kr 5 . Death From Above ± Batman & Robin: The Love Dust Courtesy of Buf Compagnie cgvr.What is Computer Graphics? (1/2) ‡ Definition ± Producing pictures or images using a computer ‡ Example ± Starship Troopers: Tango-Urilla.korea.

What is Computer Graphics? (1/2) ‡ Definition ± Producing pictures or images using a computer ‡ Example ± Starship Troopers: Tango-Urilla. Death From Above ± Batman & Robin: The Love Dust Courtesy of Buf Compagnie cgvr.korea.kr 6 .ac.

kr 7 .What is Computer Graphics? (1/2) ‡ Definition ± Producing pictures or images using a computer ‡ Example ± Starship Troopers: Tango-Urilla.ac. Death From Above ± Batman & Robin: The Love Dust Courtesy of Buf Compagnie cgvr.korea.

Death From Above ± Batman & Robin: The Love Dust Courtesy of Buf Compagnie cgvr.kr 8 .korea.What is Computer Graphics? (1/2) ‡ Definition ± Producing pictures or images using a computer ‡ Example ± Starship Troopers: Tango-Urilla.ac.

Death From Above ± Batman & Robin: The Love Dust Courtesy of Buf Compagnie cgvr.ac.What is Computer Graphics? (1/2) ‡ Definition ± Producing pictures or images using a computer ‡ Example ± Starship Troopers: Tango-Urilla.korea.kr 9 .

kr 10 .What is Computer Graphics? (2/2) ‡ Imaging ± Representing 2D images ‡ Modeling ± Representing 3D objects ‡ Rendering ± Constructing 2D images from 3D models ‡ Animation ± Simulating changes over time cgvr.ac.korea.

ac.korea.Applications ‡ ‡ ‡ ‡ ‡ Display of Information Design Simulation Computer Art Entertainment cgvr.kr 11 .

Computer Graphics is about animation (films) Major driving force now 13/02/2012 Lecture 1 12 .

Games are very important in Computer Graphics 13/02/2012 Lecture 1 13 .

Medical Imaging is another driving force 13/02/2012 Lecture 1 14 .

Computer Aided Design too 13/02/2012 Lecture 1 15 .

Scientific Visualisation To view below and above our visual range 13/02/2012 Lecture 1 16 .

First Lecture ‡ The graphics processes ± What we will cover on this course ‡ Some definitions ± Fundamental units we use in these processes 13/02/2012 Lecture 1 17 .

shading.Overview of the Course ‡ Graphics Pipeline (Today) ‡ Modelling ± Surface / Curve modelling ‡ (Local lighting effects) Illumination. lighting. mirroring.) ‡ Global illumination ‡ Curves and Surfaces 13/02/2012 Lecture 1 18 . or for storage in a bitmap file format. shadowing ‡ Rasterization (is the task of taking an image described in a vector graphics format (shapes) and converting it into a raster image (pixels or dots) for output on a video display or printer.

Graphics/Rendering Pipeline ‡ Graphics processes generally execute sequentially ‡ Pipelining the process means dividing it into stages ‡ Especially when rendering in real-time. different hardware resources are assigned for each stage 13/02/2012 Lecture 1 19 .

Graphics / Rendering Pipeline ‡ There are three stages ± Application Stage ± Geometry Stage ± Rasterization Stage 13/02/2012 Lecture 1 20 .

trackers. the application stage change the view or scene 13/02/2012 Lecture 1 21 . or sensing gloves ‡ In response to the user s input. trackballs.Application stage ‡ Entirely done in software by the CPU ‡ Read Data ± the world geometry database. ± User s input by mice.

Geometry Stage Modeling: shapes Model Transformation Transformation: viewing Hidden Surface Elimination Shading: reflection and lighting 13/02/2012 Lecture 1 Rasterization Stage 22 .

Rasterization Stage Geometry Stage Rasterization and Sampling Texture Mapping Image Composition Intensity and Colour Quantization Framebuffer/Display 13/02/2012 Lecture 1 23 .

An example thro the pipeline The scene we are trying to represent: Images courtesy of Picture Inc. 13/02/2012 Lecture 1 24 .

Geometry Pipeline Loaded 3D Models Model Transformation Transformation: viewing Hidden Surface Elimination Shading: reflection and lighting 13/02/2012 Lecture 1 Imaging Pipeline 25 .

implicit surfaces and etc.Preparing Shape Models Designed by polygons. Defined in its own coordinate system 13/02/2012 Lecture 1 26 . parametric curves/surfaces.

Model Transformation Objects put into the scene by applying translation. scaling and rotation Linear transformation called homogeneous transformation is used The location of all the vertices are updated by this transformation 13/02/2012 Lecture 1 27 .

Perspective Projection We want to create a picture of the scene viewed from the camera We apply a perspective transformation to convert the 3D coordinates to 2D coordinates of the screen Objects far away appear smaller. closer objects appear bigger 13/02/2012 Lecture 1 28 .

Hidden Surface Removal Also known as hidden surface removal (HSR). and such an algorithm is sometimes called a hider 13/02/2012 Lecture 1 29 . A hidden surface determination algorithm is a solution to the visibility problem. which was one of the first major problems in the field of 3D computer graphics. The process of hidden surface determination is sometimes called hiding. occlusion culling (OC) or visible surface determination (VSD)) is the process used to determine which surfaces and parts of surfaces are not visible from a certain viewpoint.

13/02/2012 Lecture 1 30 . help when creating the illusion of depth on paper. the darker the area appears. Likewise.Shading Shading is a process used in drawing for depicting levels of darkness on paper by applying media more densely or with a darker shade for darker areas. The closer the lines are together. the lighter the area appears. such as objects having light and shaded areas. the farther apart the lines are. and less densely or with a lighter shade for lighter areas. There are various techniques of shading including cross hatching where perpendicular lines of varying closeness are drawn in a grid pattern to shade an area. Light patterns.

Next. the Imaging Pipeline Geometry Pipeline Rasterization and Sampling Texture Mapping Image Composition Intensity and Colour Quantization Framebuffer/Display 13/02/2012 Lecture 1 31 .

Rasterization ‡ Converts the vertex information output by the geometry pipeline into pixel information needed by the video display ‡ Aliasing: distortion artifacts produced when representing a high-resolution signal at a lower resolution. ‡ Anti-aliasing : technique to remove aliasing 13/02/2012 Lecture 1 32 .

Anti-aliasing Aliased polygons (jagged edges) 13/02/2012 Lecture 1 Anti-aliased polygons 33 .

and each sub-pixel has a color.How is anti-aliasing done? Each pixel is subdivided (sub-sampled) in n regions. Compute the average color value 13/02/2012 Lecture 1 34 .

Texture mapping 13/02/2012 Lecture 1 35 .

where Texture Mapping added color to a polygon. ‡ Bump Mapping can add minute detail to an object which would otherwise require a large number of polygons. ‡ This can have a dramatic effect on the look of a polygonal object. but appears to a be bumpy. .Other covered topics: Reflections. However. ‡ Note that the polygon is still physically flat. Bump Mapping adds. shadows & Bump mapping ‡ Bump mapping is very much like Texture Mapping. what appears to be surface roughness.

Other covered topics: Global Illumination 13/02/2012 Lecture 1 37 .

Polynomial Curves. Surfaces .

Graphics Definitions ‡ Point ± a location in space. consistent density ± beginning and end on points 13/02/2012 Lecture 1 39 . 2D or 3D ± sometimes denotes one pixel ‡ Line ± straight path connecting two points ± infinitesimal width.

‡ Vertex ‡ Edge Graphics Definitions ± point in 3D ± line in 3D connecting two vertices ‡ Polygon/Face/Facet ± arbitrary shape formed by connected vertices ± fundamental unit of 3D computer graphics ‡ Mesh ± set of connected polygons forming a surface (or object) 13/02/2012 Lecture 1 40 .

Graphics Definitions ‡ Rendering : process of generating an image from the model ‡ Framebuffer : a video output device that drives a video display from a memory containing the color for every pixel 13/02/2012 Lecture 1 41 .

Term Projects ‡ What? ± Create your own graphics art ± Not still images but moving pictures ‡ When? ± Proposal after midterm exam ± Demonstration BEFORE final exam ‡ How? ± 1 or 2 person(s) / 1 team ± Using your assignments 42 .

research ‡ Mobile Adhoc Network Research Group.Contact Dept. Iqra University Islamabad ± Voice: +92-333-9171029 ± Email: awais. ISLAMABAD) IT SUPERVISOR (NEXUS TECHNOLOGIES) ‡ Visiting: ± International Islamic University Islamabad (IIUI) ± Fatima Jinnah Women University Rawalpindi ± University of Peshawar 43 . Iqra University Islamabad ± Wireless Sensor Network ± Image Processing ‡ Practical/Industrial Experience: ± ± IT Engineer (TELENOR.ahmad@live. Of Computing and Technology.com ± Skype: awais.