GUI Programming Graham Hardman ([email protected]) 12 th June 2002.
1.1 SI31_2001 SI31 Advanced Computer Graphics AGR Ken Brodlie [email protected] Lecture 1 -...
-
Upload
benjamin-clarke -
Category
Documents
-
view
215 -
download
0
Transcript of 1.1 SI31_2001 SI31 Advanced Computer Graphics AGR Ken Brodlie [email protected] Lecture 1 -...
![Page 1: 1.1 SI31_2001 SI31 Advanced Computer Graphics AGR Ken Brodlie kwb@comp.leeds.ac.uk Lecture 1 - Overview.](https://reader035.fdocuments.net/reader035/viewer/2022070306/5515fb71550346d46f8b58c0/html5/thumbnails/1.jpg)
1.1SI31_2001
SI31Advanced Computer
GraphicsAGR
SI31Advanced Computer
GraphicsAGR
Lecture 1 - Overview
![Page 2: 1.1 SI31_2001 SI31 Advanced Computer Graphics AGR Ken Brodlie kwb@comp.leeds.ac.uk Lecture 1 - Overview.](https://reader035.fdocuments.net/reader035/viewer/2022070306/5515fb71550346d46f8b58c0/html5/thumbnails/2.jpg)
1.2SI31_2001
ObjectivesObjectives
To understand how 3D scenes can be modelled - in terms of geometry, appearance and behaviour - and rendered on a display
To understand how to deliver interactive animated 3D graphics over the Internet
To be able to create interactive 3D graphics applications using industry standard software (OpenGL, VRML and POVRAY)
![Page 3: 1.1 SI31_2001 SI31 Advanced Computer Graphics AGR Ken Brodlie kwb@comp.leeds.ac.uk Lecture 1 - Overview.](https://reader035.fdocuments.net/reader035/viewer/2022070306/5515fb71550346d46f8b58c0/html5/thumbnails/3.jpg)
1.3SI31_2001
Lecture Outline - The Basics
Lecture Outline - The Basics
MODELLING– representing objects in 3D– transforming objects and composing scenes
VIEWING– projecting 3D scenes onto a 2D display
surface RENDERING
– illumination– shading– adding realism via textures, shadows
![Page 4: 1.1 SI31_2001 SI31 Advanced Computer Graphics AGR Ken Brodlie kwb@comp.leeds.ac.uk Lecture 1 - Overview.](https://reader035.fdocuments.net/reader035/viewer/2022070306/5515fb71550346d46f8b58c0/html5/thumbnails/4.jpg)
1.4SI31_2001
Basic ModellingBasic Modelling
x
y
z
objects representedas set of faces - iepolygons- and facesas a set of points
scenes composedby scaling, rotating,translating objects tocreate a 3D world
![Page 5: 1.1 SI31_2001 SI31 Advanced Computer Graphics AGR Ken Brodlie kwb@comp.leeds.ac.uk Lecture 1 - Overview.](https://reader035.fdocuments.net/reader035/viewer/2022070306/5515fb71550346d46f8b58c0/html5/thumbnails/5.jpg)
1.5SI31_2001
ViewingViewing
Clipping– selects a volume of interest
Projection– 3D scene is projected onto a 2D
plane
camera
![Page 6: 1.1 SI31_2001 SI31 Advanced Computer Graphics AGR Ken Brodlie kwb@comp.leeds.ac.uk Lecture 1 - Overview.](https://reader035.fdocuments.net/reader035/viewer/2022070306/5515fb71550346d46f8b58c0/html5/thumbnails/6.jpg)
1.6SI31_2001
RenderingRendering
??
shading:how do we use ourknowledge of illuminationto shade surfaces in ourworld?
illumination:how is light reflectedfrom surfaces?
![Page 7: 1.1 SI31_2001 SI31 Advanced Computer Graphics AGR Ken Brodlie kwb@comp.leeds.ac.uk Lecture 1 - Overview.](https://reader035.fdocuments.net/reader035/viewer/2022070306/5515fb71550346d46f8b58c0/html5/thumbnails/7.jpg)
1.7SI31_2001
RenderingRendering
texture
shadows
![Page 8: 1.1 SI31_2001 SI31 Advanced Computer Graphics AGR Ken Brodlie kwb@comp.leeds.ac.uk Lecture 1 - Overview.](https://reader035.fdocuments.net/reader035/viewer/2022070306/5515fb71550346d46f8b58c0/html5/thumbnails/8.jpg)
1.8SI31_2001
Lecture Outline - InternetLecture Outline - Internet
VRML– ISO standard for 3D graphics over
the Web– allows modelling of geometry,
appearance and behaviour
![Page 9: 1.1 SI31_2001 SI31 Advanced Computer Graphics AGR Ken Brodlie kwb@comp.leeds.ac.uk Lecture 1 - Overview.](https://reader035.fdocuments.net/reader035/viewer/2022070306/5515fb71550346d46f8b58c0/html5/thumbnails/9.jpg)
1.9SI31_2001
Lecture Outline - Advanced
Lecture Outline - Advanced
ADVANCED RENDERING– direct versus global illumination
methods– ray tracing and radiosity
OTHER ADVANCED FEATURES– curve and surface modelling– image based rendering– non-photorealistic rendering
![Page 10: 1.1 SI31_2001 SI31 Advanced Computer Graphics AGR Ken Brodlie kwb@comp.leeds.ac.uk Lecture 1 - Overview.](https://reader035.fdocuments.net/reader035/viewer/2022070306/5515fb71550346d46f8b58c0/html5/thumbnails/10.jpg)
1.10SI31_2001
Lecture Outline - Advanced
Lecture Outline - Advanced
Advanced Rendering - global illumination– ray tracing
– radiositybased on physics of radiative heat
transfer between surfaces
light
eye
screen
objects
![Page 11: 1.1 SI31_2001 SI31 Advanced Computer Graphics AGR Ken Brodlie kwb@comp.leeds.ac.uk Lecture 1 - Overview.](https://reader035.fdocuments.net/reader035/viewer/2022070306/5515fb71550346d46f8b58c0/html5/thumbnails/11.jpg)
1.11SI31_2001
Ray TracingRay Tracing
![Page 12: 1.1 SI31_2001 SI31 Advanced Computer Graphics AGR Ken Brodlie kwb@comp.leeds.ac.uk Lecture 1 - Overview.](https://reader035.fdocuments.net/reader035/viewer/2022070306/5515fb71550346d46f8b58c0/html5/thumbnails/12.jpg)
1.12SI31_2001
Ray TracingRay Tracing
POVRAY - freely available ray tracing software
http://www.povray.org
![Page 13: 1.1 SI31_2001 SI31 Advanced Computer Graphics AGR Ken Brodlie kwb@comp.leeds.ac.uk Lecture 1 - Overview.](https://reader035.fdocuments.net/reader035/viewer/2022070306/5515fb71550346d46f8b58c0/html5/thumbnails/13.jpg)
1.13SI31_2001
RadiosityRadiosity
from www.lightscape.com
![Page 14: 1.1 SI31_2001 SI31 Advanced Computer Graphics AGR Ken Brodlie kwb@comp.leeds.ac.uk Lecture 1 - Overview.](https://reader035.fdocuments.net/reader035/viewer/2022070306/5515fb71550346d46f8b58c0/html5/thumbnails/14.jpg)
1.14SI31_2001
Practical OutlinePractical Outline
Basic graphics programming– creation of interactive 3D worlds using
OpenGL Web graphics
– creating interactive, animated 3D virtual worlds on the Web using VRML
Advanced rendering– using POVRAY
Practical work will use the Linux and NT machines
![Page 15: 1.1 SI31_2001 SI31 Advanced Computer Graphics AGR Ken Brodlie kwb@comp.leeds.ac.uk Lecture 1 - Overview.](https://reader035.fdocuments.net/reader035/viewer/2022070306/5515fb71550346d46f8b58c0/html5/thumbnails/15.jpg)
1.15SI31_2001
AGR AGR
Mastersclasses– additional seminars / study groups
on more advanced topics in computer graphics and virtual environments… such as simulation of soft objects
Additional practical project
![Page 16: 1.1 SI31_2001 SI31 Advanced Computer Graphics AGR Ken Brodlie kwb@comp.leeds.ac.uk Lecture 1 - Overview.](https://reader035.fdocuments.net/reader035/viewer/2022070306/5515fb71550346d46f8b58c0/html5/thumbnails/16.jpg)
1.16SI31_2001
Course InfoCourse Info
Lectures– Monday 2.00 - 3.00 (LT19)– Tuesday 1.00 - 2.00 (LT25)
Practicals Web site
– http://www.comp.leeds.ac.uk/kwb/si31 Newsgroups
– local.modules.si31 local.modules.agr– local.modules.si31.talk
local.modules.agr.talk
![Page 17: 1.1 SI31_2001 SI31 Advanced Computer Graphics AGR Ken Brodlie kwb@comp.leeds.ac.uk Lecture 1 - Overview.](https://reader035.fdocuments.net/reader035/viewer/2022070306/5515fb71550346d46f8b58c0/html5/thumbnails/17.jpg)
1.17SI31_2001
BooksBooks
Computer Graphics (second edition)– Hearn and Baker, Prentice Hall
3D Computer Graphics (third edition)– Alan Watt, Addison Wesley
OpenGL Manual
![Page 18: 1.1 SI31_2001 SI31 Advanced Computer Graphics AGR Ken Brodlie kwb@comp.leeds.ac.uk Lecture 1 - Overview.](https://reader035.fdocuments.net/reader035/viewer/2022070306/5515fb71550346d46f8b58c0/html5/thumbnails/18.jpg)
1.18SI31_2001
BooksBooks
Introduction to Computer Graphics– Foley, van Dam, Feiner and Hughes,
Addison-Wesley Interactive Computer Graphics (top-
down approach using OpenGL)– Angel, Addison Wesley
The VRML 2.0 Handbook– Hartman and Wernecke, Addison-Wesley
3D Games– Alan Watt and Fabio Policarpo
![Page 19: 1.1 SI31_2001 SI31 Advanced Computer Graphics AGR Ken Brodlie kwb@comp.leeds.ac.uk Lecture 1 - Overview.](https://reader035.fdocuments.net/reader035/viewer/2022070306/5515fb71550346d46f8b58c0/html5/thumbnails/19.jpg)
1.19SI31_2001
AssessmentAssessment
Module Examination Coursework
SI31 67% 33%
AGR 60% 40%
![Page 20: 1.1 SI31_2001 SI31 Advanced Computer Graphics AGR Ken Brodlie kwb@comp.leeds.ac.uk Lecture 1 - Overview.](https://reader035.fdocuments.net/reader035/viewer/2022070306/5515fb71550346d46f8b58c0/html5/thumbnails/20.jpg)
1.20SI31_2001
Applications - Computer Games
Applications - Computer Games
![Page 21: 1.1 SI31_2001 SI31 Advanced Computer Graphics AGR Ken Brodlie kwb@comp.leeds.ac.uk Lecture 1 - Overview.](https://reader035.fdocuments.net/reader035/viewer/2022070306/5515fb71550346d46f8b58c0/html5/thumbnails/21.jpg)
1.21SI31_2001
Applications - Computer-Aided Design
Applications - Computer-Aided Design
This is Hubble Space Telescope modeled using the BRL-CAD system
Uses CSG modeling and ray tracing for rendering
http://ftp.arl.mil/brlcad
![Page 22: 1.1 SI31_2001 SI31 Advanced Computer Graphics AGR Ken Brodlie kwb@comp.leeds.ac.uk Lecture 1 - Overview.](https://reader035.fdocuments.net/reader035/viewer/2022070306/5515fb71550346d46f8b58c0/html5/thumbnails/22.jpg)
1.22SI31_2001
Applications - Virtual Reality
Applications - Virtual Reality
Virtual oceanarium built for EXPO in Lisbon
Example taken from Fraunhofer Institute site
http://www.igd.fhg.de
![Page 23: 1.1 SI31_2001 SI31 Advanced Computer Graphics AGR Ken Brodlie kwb@comp.leeds.ac.uk Lecture 1 - Overview.](https://reader035.fdocuments.net/reader035/viewer/2022070306/5515fb71550346d46f8b58c0/html5/thumbnails/23.jpg)
1.23SI31_2001
Applications - Cartography and GIS
Applications - Cartography and GIS
Ordnance Survey
http://www.ordsvy.gov.uk
GIS-3D also from Fraunhofer Institute
![Page 24: 1.1 SI31_2001 SI31 Advanced Computer Graphics AGR Ken Brodlie kwb@comp.leeds.ac.uk Lecture 1 - Overview.](https://reader035.fdocuments.net/reader035/viewer/2022070306/5515fb71550346d46f8b58c0/html5/thumbnails/24.jpg)
1.24SI31_2001
Applications - Computer Art
Applications - Computer Art
This example can be found on the SIGGRAPH Web Site
Important computer graphics resource
http:www.siggraph.org
![Page 25: 1.1 SI31_2001 SI31 Advanced Computer Graphics AGR Ken Brodlie kwb@comp.leeds.ac.uk Lecture 1 - Overview.](https://reader035.fdocuments.net/reader035/viewer/2022070306/5515fb71550346d46f8b58c0/html5/thumbnails/25.jpg)
1.25SI31_2001
Applications - Scientific Visualization
Applications - Scientific Visualization
Turning scientific data into pictures
– with applications to medicine and computer simulations
![Page 26: 1.1 SI31_2001 SI31 Advanced Computer Graphics AGR Ken Brodlie kwb@comp.leeds.ac.uk Lecture 1 - Overview.](https://reader035.fdocuments.net/reader035/viewer/2022070306/5515fb71550346d46f8b58c0/html5/thumbnails/26.jpg)
1.26SI31_2001
Before we begin...mathematics!
Before we begin...mathematics!
3D Co-ordinate Systems
LEFT RIGHT
x
yz
x
y
z
z points away z points toward
Align thumb with x, first finger with y, then second fingerof appropriate hand gives z direction. Common now touse a RIGHT HANDED system.
![Page 27: 1.1 SI31_2001 SI31 Advanced Computer Graphics AGR Ken Brodlie kwb@comp.leeds.ac.uk Lecture 1 - Overview.](https://reader035.fdocuments.net/reader035/viewer/2022070306/5515fb71550346d46f8b58c0/html5/thumbnails/27.jpg)
1.27SI31_2001
Points and VectorsPoints and Vectors
We shall write points as column vectors
xyz
P =
Difference of two points gives a direction vector:D = P2 - P1
x
y
z
P2
P1
x
y
z
P
Note: If P1 and P2
are on a plane, thenD lies in the plane
![Page 28: 1.1 SI31_2001 SI31 Advanced Computer Graphics AGR Ken Brodlie kwb@comp.leeds.ac.uk Lecture 1 - Overview.](https://reader035.fdocuments.net/reader035/viewer/2022070306/5515fb71550346d46f8b58c0/html5/thumbnails/28.jpg)
1.28SI31_2001
Magnitude of a VectorMagnitude of a Vector
The magnitude of a vector V = (v1,v2,v3)T is given by:
|V| = sqrt(v1*v1 + v2*v2 + v3*v3)
eg (1,2,3)T has magnitude sqrt(14) A unit vector has magnitude 1 A unit vector in the direction of
V is V / |V|
![Page 29: 1.1 SI31_2001 SI31 Advanced Computer Graphics AGR Ken Brodlie kwb@comp.leeds.ac.uk Lecture 1 - Overview.](https://reader035.fdocuments.net/reader035/viewer/2022070306/5515fb71550346d46f8b58c0/html5/thumbnails/29.jpg)
1.29SI31_2001
Scalar or Dot ProductScalar or Dot Product
The scalar product, or dot product, of two vectors U and V is defined as:
U.V = u1*v1 + u2*v2 + u3*v3
It is important in computer graphics because we can show that also:
U.V = |U|*|V|*coswhere is the angle between U and V
This lets us calculate angle ascos = (u1*v1 + u2*v2 + u3*v3) / (|U|*|V|)
![Page 30: 1.1 SI31_2001 SI31 Advanced Computer Graphics AGR Ken Brodlie kwb@comp.leeds.ac.uk Lecture 1 - Overview.](https://reader035.fdocuments.net/reader035/viewer/2022070306/5515fb71550346d46f8b58c0/html5/thumbnails/30.jpg)
1.30SI31_2001
Diffuse LightingDiffuse Lighting
Diffuse reflection depends on angle between light direction and surface normal:reflected intensity = light intensity *
cosine of angle between light direction and surface normal
light normal
scalar product letsus calculate cos
![Page 31: 1.1 SI31_2001 SI31 Advanced Computer Graphics AGR Ken Brodlie kwb@comp.leeds.ac.uk Lecture 1 - Overview.](https://reader035.fdocuments.net/reader035/viewer/2022070306/5515fb71550346d46f8b58c0/html5/thumbnails/31.jpg)
1.31SI31_2001
Vector or Cross ProductVector or Cross Product
The vector or cross product is defined as:UxV = (u2v3 - u3v2, u3v1 - u1v3, u1v2 - u2v1)
We can also show that:UxV = N |U||V| sin where N is unit vector orthogonal to U and V
(forming a right handed system) and is angle between U and V
This allows us to find the normal to a plane– cross-product of two directions lying in plane ,
eg (P3-P2), (P2-P1), where P1, P2, P3 are three points in the plane
![Page 32: 1.1 SI31_2001 SI31 Advanced Computer Graphics AGR Ken Brodlie kwb@comp.leeds.ac.uk Lecture 1 - Overview.](https://reader035.fdocuments.net/reader035/viewer/2022070306/5515fb71550346d46f8b58c0/html5/thumbnails/32.jpg)
1.32SI31_2001
ExercisesExercises
Convince yourself that the x-axis is represented by the vector (1,0,0)
What is the unit normal in the direction (2,3,4)?
What is the angle between the vectors (1,1,0) and (1,0,0)?
Which vector is orthogonal to the vectors (1,0,0) and (0,1,0)?
What is the normal to the plane through the points (1,2,3), (3,4,5) and (0,0,0)?