welcome to csci 480, computer graphics introduction instructor: erin shaw, ta: tbdinstructor: erin...
TRANSCRIPT
Welcome to Welcome to CSCI 480, Computer CSCI 480, Computer GraphicsGraphics
IntroductionIntroduction• Instructor: Erin Shaw, TA: TBDInstructor: Erin Shaw, TA: TBD
Class web page Class web page • http://www.http://www.isiisi..eduedu/~/~shawshaw/cs480/index.html/cs480/index.html
AssignmentAssignment• Reading: Chapter 1of Angel textbookReading: Chapter 1of Angel textbook
• Project 1: Follow homework icon to project1Project 1: Follow homework icon to project1
• Online registration and survey: TBPOnline registration and survey: TBP
IntroductionIntroduction• Instructor: Erin Shaw, TA: TBDInstructor: Erin Shaw, TA: TBD
Class web page Class web page • http://www.http://www.isiisi..eduedu/~/~shawshaw/cs480/index.html/cs480/index.html
AssignmentAssignment• Reading: Chapter 1of Angel textbookReading: Chapter 1of Angel textbook
• Project 1: Follow homework icon to project1Project 1: Follow homework icon to project1
• Online registration and survey: TBPOnline registration and survey: TBP
What is Computer What is Computer Graphics?Graphics?
Computer Graphics isComputer Graphics is
The technology for presenting informationThe technology for presenting information
Towards this end, we need to... Towards this end, we need to... • process, transform, and display dataprocess, transform, and display data
...and must take the following into account...and must take the following into account• Origin (where does it come from?)Origin (where does it come from?)
• Throughput (how much of it can I process?)Throughput (how much of it can I process?)
• Latency (how long do I have to wait)?Latency (how long do I have to wait)?
• Presentation (what does it look like?)Presentation (what does it look like?)
Computer Graphics isComputer Graphics is
The technology for presenting informationThe technology for presenting information
Towards this end, we need to... Towards this end, we need to... • process, transform, and display dataprocess, transform, and display data
...and must take the following into account...and must take the following into account• Origin (where does it come from?)Origin (where does it come from?)
• Throughput (how much of it can I process?)Throughput (how much of it can I process?)
• Latency (how long do I have to wait)?Latency (how long do I have to wait)?
• Presentation (what does it look like?)Presentation (what does it look like?)
CSCI 480 is CSCI 480 is Computer Science!Computer Science!
We will cover...We will cover...• Graphics programming Graphics programming
algorithms algorithms • Graphics data structures Graphics data structures • Color & human vision Color & human vision • Graphical interface design Graphical interface design
& programming & programming • Geometry & modeling Geometry & modeling • ……..and by necessity, ..and by necessity,
OpenGlOpenGl
We will cover...We will cover...• Graphics programming Graphics programming
algorithms algorithms • Graphics data structures Graphics data structures • Color & human vision Color & human vision • Graphical interface design Graphical interface design
& programming & programming • Geometry & modeling Geometry & modeling • ……..and by necessity, ..and by necessity,
OpenGlOpenGl
It is notIt is not• Image/Illus. packagesImage/Illus. packages
- Adobe Photoshop, Illus. Adobe Photoshop, Illus.
• CAD packagesCAD packages- AutoCAD AutoCAD
• Rendering packagesRendering packages- Renderman,LightscapeRenderman,Lightscape
• Modeling packagesModeling packages- 3D Studio MAX 3D Studio MAX
• Animation packagesAnimation packages- Flash, Digimation Flash, Digimation
It is notIt is not• Image/Illus. packagesImage/Illus. packages
- Adobe Photoshop, Illus. Adobe Photoshop, Illus.
• CAD packagesCAD packages- AutoCAD AutoCAD
• Rendering packagesRendering packages- Renderman,LightscapeRenderman,Lightscape
• Modeling packagesModeling packages- 3D Studio MAX 3D Studio MAX
• Animation packagesAnimation packages- Flash, Digimation Flash, Digimation
CSCI 480 goalsCSCI 480 goals
The goal of this semester is many-foldThe goal of this semester is many-fold• hands-on graphics programming experience hands-on graphics programming experience
with industry toolswith industry tools
• emphasis on 3D and renderingemphasis on 3D and rendering
• mathematical underpinningsmathematical underpinnings
• familiarity with the fieldfamiliarity with the field
If only we had more time!If only we had more time!
The goal of this semester is many-foldThe goal of this semester is many-fold• hands-on graphics programming experience hands-on graphics programming experience
with industry toolswith industry tools
• emphasis on 3D and renderingemphasis on 3D and rendering
• mathematical underpinningsmathematical underpinnings
• familiarity with the fieldfamiliarity with the field
If only we had more time!If only we had more time!
Who am I?Who am I?
Non-facultyNon-faculty• Research scientist at USC’s Information Research scientist at USC’s Information
Sciences Institute (since 1995)Sciences Institute (since 1995)- Distance education, virtual intelligent tutors, UI Distance education, virtual intelligent tutors, UI
design, past research in CG and digital librariesdesign, past research in CG and digital libraries
Graphics backgroundGraphics background• MS from Program of Computer Graphics at MS from Program of Computer Graphics at
Cornell UniversityCornell University
• Employee #12 of startup company Edsun Employee #12 of startup company Edsun Labs, built new CEG chip for anti-aliasingLabs, built new CEG chip for anti-aliasing
Non-facultyNon-faculty• Research scientist at USC’s Information Research scientist at USC’s Information
Sciences Institute (since 1995)Sciences Institute (since 1995)- Distance education, virtual intelligent tutors, UI Distance education, virtual intelligent tutors, UI
design, past research in CG and digital librariesdesign, past research in CG and digital libraries
Graphics backgroundGraphics background• MS from Program of Computer Graphics at MS from Program of Computer Graphics at
Cornell UniversityCornell University
• Employee #12 of startup company Edsun Employee #12 of startup company Edsun Labs, built new CEG chip for anti-aliasingLabs, built new CEG chip for anti-aliasing
LectureLecture
• Graphics applicationsGraphics applications
• Display architectures and devicesDisplay architectures and devices
• ImagesImages- LightLight- Human visual systemHuman visual system- Camera modelsCamera models
• APIs and OpenGLAPIs and OpenGL
• Rendering pipelineRendering pipeline
• Graphics applicationsGraphics applications
• Display architectures and devicesDisplay architectures and devices
• ImagesImages- LightLight- Human visual systemHuman visual system- Camera modelsCamera models
• APIs and OpenGLAPIs and OpenGL
• Rendering pipelineRendering pipeline
Graphics displaysGraphics displays
MotivationMotivation• How to keep display screen refreshed as more How to keep display screen refreshed as more
data is displayed at higher resolutions?data is displayed at higher resolutions?
Frame buffer (video memory) holds Frame buffer (video memory) holds screen datascreen data• Buffer size (width x len) = screen resolutionBuffer size (width x len) = screen resolution
• Buffer depth = no. bits per pixel = no. colorsBuffer depth = no. bits per pixel = no. colors- number of colors = 2number of colors = 2number_of_bitsnumber_of_bits
- 1 bit per pixel: bit can be 0 or 1, or black or white1 bit per pixel: bit can be 0 or 1, or black or white- 8 bits per pixel gives 256 colors, or 8 bits per pixel gives 256 colors, or intensitiesintensities
MotivationMotivation• How to keep display screen refreshed as more How to keep display screen refreshed as more
data is displayed at higher resolutions?data is displayed at higher resolutions?
Frame buffer (video memory) holds Frame buffer (video memory) holds screen datascreen data• Buffer size (width x len) = screen resolutionBuffer size (width x len) = screen resolution
• Buffer depth = no. bits per pixel = no. colorsBuffer depth = no. bits per pixel = no. colors- number of colors = 2number of colors = 2number_of_bitsnumber_of_bits
- 1 bit per pixel: bit can be 0 or 1, or black or white1 bit per pixel: bit can be 0 or 1, or black or white- 8 bits per pixel gives 256 colors, or 8 bits per pixel gives 256 colors, or intensitiesintensities
Graphics displaysGraphics displays
Color systems require at least 3 timesColor systems require at least 3 times
as much memoryas much memory• Typically 8-bit buffer for each color (RGB)Typically 8-bit buffer for each color (RGB)
• True colorTrue color is at least 24 bits per pixel is at least 24 bits per pixel
• 32 bit systems are RGBA, where A is alpha, 32 bit systems are RGBA, where A is alpha, the transparency valuethe transparency value
• Video memory is highly specializedVideo memory is highly specialized- VVideoideoRAM, DRAM, DynamicynamicRAM, SDRAM, etc.RAM, SDRAM, etc.
- article on accelerator boardsarticle on accelerator boards
Color systems require at least 3 timesColor systems require at least 3 times
as much memoryas much memory• Typically 8-bit buffer for each color (RGB)Typically 8-bit buffer for each color (RGB)
• True colorTrue color is at least 24 bits per pixel is at least 24 bits per pixel
• 32 bit systems are RGBA, where A is alpha, 32 bit systems are RGBA, where A is alpha, the transparency valuethe transparency value
• Video memory is highly specializedVideo memory is highly specialized- VVideoideoRAM, DRAM, DynamicynamicRAM, SDRAM, etc.RAM, SDRAM, etc.
- article on accelerator boardsarticle on accelerator boards
Graphics displaysGraphics displays
Rasterization Rasterization • Is the process of converting geometric entities Is the process of converting geometric entities
(lines and curves) to pixel assignments in the (lines and curves) to pixel assignments in the frame bufferframe buffer
• Most monitors and printers are raster-basedMost monitors and printers are raster-based
• Rasterization can be done in hardware, Rasterization can be done in hardware, sofware, or a combination of the twosofware, or a combination of the two
• Rasterization is the final step of the Rasterization is the final step of the rendering rendering pipelinepipeline
Rasterization Rasterization • Is the process of converting geometric entities Is the process of converting geometric entities
(lines and curves) to pixel assignments in the (lines and curves) to pixel assignments in the frame bufferframe buffer
• Most monitors and printers are raster-basedMost monitors and printers are raster-based
• Rasterization can be done in hardware, Rasterization can be done in hardware, sofware, or a combination of the twosofware, or a combination of the two
• Rasterization is the final step of the Rasterization is the final step of the rendering rendering pipelinepipeline
LectureLecture
• Graphics applicationsGraphics applications
• Display architectures and devicesDisplay architectures and devices
• ImagesImages- LightLight- Human visual systemHuman visual system- Camera modelsCamera models
• APIs and OpenGLAPIs and OpenGL
• Rendering pipelineRendering pipeline
• Graphics applicationsGraphics applications
• Display architectures and devicesDisplay architectures and devices
• ImagesImages- LightLight- Human visual systemHuman visual system- Camera modelsCamera models
• APIs and OpenGLAPIs and OpenGL
• Rendering pipelineRendering pipeline
Display devicesDisplay devices
More on display devicesMore on display devices• http://www.pctechguide.com/07panels.htmhttp://www.pctechguide.com/07panels.htm
• http://www.magnavox.com:81/http://www.magnavox.com:81/electreference/videohandbook/tvset.htmlelectreference/videohandbook/tvset.html
• http://144.126.176.216/Displays/c3_s1.htmhttp://144.126.176.216/Displays/c3_s1.htm
• http://www.ul.ie/~flanagan/ghardw/lcd.htmlhttp://www.ul.ie/~flanagan/ghardw/lcd.html
More on display devicesMore on display devices• http://www.pctechguide.com/07panels.htmhttp://www.pctechguide.com/07panels.htm
• http://www.magnavox.com:81/http://www.magnavox.com:81/electreference/videohandbook/tvset.htmlelectreference/videohandbook/tvset.html
• http://144.126.176.216/Displays/c3_s1.htmhttp://144.126.176.216/Displays/c3_s1.htm
• http://www.ul.ie/~flanagan/ghardw/lcd.htmlhttp://www.ul.ie/~flanagan/ghardw/lcd.html
LectureLecture
• Graphics applicationsGraphics applications
• Display architectures and devicesDisplay architectures and devices
• ImagesImages- LightLight- Human visual systemHuman visual system- Camera modelsCamera models
• APIs and OpenGLAPIs and OpenGL
• Rendering pipelineRendering pipeline
• Graphics applicationsGraphics applications
• Display architectures and devicesDisplay architectures and devices
• ImagesImages- LightLight- Human visual systemHuman visual system- Camera modelsCamera models
• APIs and OpenGLAPIs and OpenGL
• Rendering pipelineRendering pipeline
ImagesImages
We will follow the book’s top-down We will follow the book’s top-down approachapproach• Instead of starting with 2D and generalizing, Instead of starting with 2D and generalizing,
we will jump right into 3D, using OpenGL.we will jump right into 3D, using OpenGL.
3D CG images are synthetic3D CG images are synthetic• That is, they do not exist physicallyThat is, they do not exist physically
• Often this is obvious, sometimes it is not - this Often this is obvious, sometimes it is not - this is the goal of physically-based rendering is the goal of physically-based rendering
• We want to create synthetic images the same We want to create synthetic images the same way we create traditional imagesway we create traditional images
We will follow the book’s top-down We will follow the book’s top-down approachapproach• Instead of starting with 2D and generalizing, Instead of starting with 2D and generalizing,
we will jump right into 3D, using OpenGL.we will jump right into 3D, using OpenGL.
3D CG images are synthetic3D CG images are synthetic• That is, they do not exist physicallyThat is, they do not exist physically
• Often this is obvious, sometimes it is not - this Often this is obvious, sometimes it is not - this is the goal of physically-based rendering is the goal of physically-based rendering
• We want to create synthetic images the same We want to create synthetic images the same way we create traditional imagesway we create traditional images
ImagesImages
3D objects are first modeled3D objects are first modeled• Typically, with a CAD program that outputs Typically, with a CAD program that outputs
either a list of polygons (either a list of polygons (verticesvertices) or a ) or a scene scene graphgraph of primitive objects. of primitive objects.
• They exist independently of a viewerThey exist independently of a viewer- object space verse camera (eye) spaceobject space verse camera (eye) space
3D objects are first modeled3D objects are first modeled• Typically, with a CAD program that outputs Typically, with a CAD program that outputs
either a list of polygons (either a list of polygons (verticesvertices) or a ) or a scene scene graphgraph of primitive objects. of primitive objects.
• They exist independently of a viewerThey exist independently of a viewer- object space verse camera (eye) spaceobject space verse camera (eye) space
ImagesImages
3D objects are then rendered3D objects are then rendered• We account for the viewer at this stageWe account for the viewer at this stage
• We are the cameras in our world We are the cameras in our world (but synthetic cameras are more versatile!)(but synthetic cameras are more versatile!)
• Images are 2 dimensionalImages are 2 dimensional
• Images would be black without light!Images would be black without light!
3D objects are then rendered3D objects are then rendered• We account for the viewer at this stageWe account for the viewer at this stage
• We are the cameras in our world We are the cameras in our world (but synthetic cameras are more versatile!)(but synthetic cameras are more versatile!)
• Images are 2 dimensionalImages are 2 dimensional
• Images would be black without light!Images would be black without light!
What is light?What is light?
Visible light is electromagnetic radiationVisible light is electromagnetic radiation• Specifically, it’s the portion of the Specifically, it’s the portion of the
electromagnetic spectrum that the eye can electromagnetic spectrum that the eye can detectdetect
• Electromagnetic radiation = radiant energyElectromagnetic radiation = radiant energy
• Characterized by eitherCharacterized by either- wavelength (wavelength (), in nanometers (nm) ), in nanometers (nm) - frequency (frequency (ff), in Hertz (Hz)), in Hertz (Hz)
Visible light is electromagnetic radiationVisible light is electromagnetic radiation• Specifically, it’s the portion of the Specifically, it’s the portion of the
electromagnetic spectrum that the eye can electromagnetic spectrum that the eye can detectdetect
• Electromagnetic radiation = radiant energyElectromagnetic radiation = radiant energy
• Characterized by eitherCharacterized by either- wavelength (wavelength (), in nanometers (nm) ), in nanometers (nm) - frequency (frequency (ff), in Hertz (Hz)), in Hertz (Hz)
Electromagnetic Electromagnetic spectrumspectrum
cosm
ic r
ays
cosm
ic r
ays
gam
ma
rays
gam
ma
rays
x ra
ysx
rays
ultr
avio
let
ultr
avio
let
visi
ble
visi
ble
infr
ared
infr
ared
rada
rra
dar
radi
ora
dio
shor
t wav
esh
ort w
ave
TV
TV
FMFM
elec
tric
ity
elec
tric
ity
(ac
curr
ent)
(ac
curr
ent)
105 nm 3.9 x 1013 inch105 nm 3.9 x 1013 inch
1016 nm 3100 miles1016 nm 3100 miles
Frequency (Hz)Frequency (Hz)
Wavelength (nm)Wavelength (nm)
Imaging systemsImaging systems
Three examplesThree examples• Human visual systemHuman visual system
• Pinhole cameraPinhole camera
• Graphics rendererGraphics renderer
Our goal is to understand how images Our goal is to understand how images are formed visually, with a camera, are formed visually, with a camera, then on a computerthen on a computer
Three examplesThree examples• Human visual systemHuman visual system
• Pinhole cameraPinhole camera
• Graphics rendererGraphics renderer
Our goal is to understand how images Our goal is to understand how images are formed visually, with a camera, are formed visually, with a camera, then on a computerthen on a computer
Human visual systemHuman visual system
2. Iris opens and closes pupil to adjust amount of light
2. Iris opens and closes pupil to adjust amount of light
3. Lens helps focus image on retina
3. Lens helps focus image on retina
4. Photoreceptors in retina collect light and convert energy to impulses
4. Photoreceptors in retina collect light and convert energy to impulses
1. Light enters through cornea
1. Light enters through cornea
*Reference:http://members.aol.com/osleye/Main.htm
Visual acuityVisual acuity
Visual acuity is defined asVisual acuity is defined as• A measure of the ability of the eye to A measure of the ability of the eye to
distinguish detail distinguish detail
Four factors affect visual acuityFour factors affect visual acuity• Size, luminance, contrast, timeSize, luminance, contrast, time
The amount of light reaching the eye isThe amount of light reaching the eye is• brightness (a subjective interpretation) brightness (a subjective interpretation)
• luminance (an objective physical quantity)luminance (an objective physical quantity)
• radiance (also an objective physical quantity)radiance (also an objective physical quantity)
Visual acuity is defined asVisual acuity is defined as• A measure of the ability of the eye to A measure of the ability of the eye to
distinguish detail distinguish detail
Four factors affect visual acuityFour factors affect visual acuity• Size, luminance, contrast, timeSize, luminance, contrast, time
The amount of light reaching the eye isThe amount of light reaching the eye is• brightness (a subjective interpretation) brightness (a subjective interpretation)
• luminance (an objective physical quantity)luminance (an objective physical quantity)
• radiance (also an objective physical quantity)radiance (also an objective physical quantity)
Radiometry vs Radiometry vs photometryphotometry
RadiometryRadiometry• Physical measurement (all electromag energy)Physical measurement (all electromag energy)
• Used by optical and radiation engineersUsed by optical and radiation engineers
PhotometryPhotometry• How a human observer responds to lightHow a human observer responds to light
• Perceptual measurement (visible light only)Perceptual measurement (visible light only)
• Used by illumination engineers and Used by illumination engineers and perceptual psychologistsperceptual psychologists
RadiometryRadiometry• Physical measurement (all electromag energy)Physical measurement (all electromag energy)
• Used by optical and radiation engineersUsed by optical and radiation engineers
PhotometryPhotometry• How a human observer responds to lightHow a human observer responds to light
• Perceptual measurement (visible light only)Perceptual measurement (visible light only)
• Used by illumination engineers and Used by illumination engineers and perceptual psychologistsperceptual psychologists
Radiometric vs Radiometric vs photometricphotometric
Radiant energy (joule)Radiant energy (joule)
Radiant power (W=J/sec)Radiant power (W=J/sec)
Irradiance (W/m²)Irradiance (W/m²)
Radiant Exitance (W/m²)Radiant Exitance (W/m²)
Radiance (W/sr m²)Radiance (W/sr m²)
Radiant energy (joule)Radiant energy (joule)
Radiant power (W=J/sec)Radiant power (W=J/sec)
Irradiance (W/m²)Irradiance (W/m²)
Radiant Exitance (W/m²)Radiant Exitance (W/m²)
Radiance (W/sr m²)Radiance (W/sr m²)
Luminous energy (talbot)Luminous energy (talbot)
Luminous power (lm=talbot/sec)Luminous power (lm=talbot/sec)
Illuminance (lm/ m²)Illuminance (lm/ m²)
Luminous Exitance (lm/m²)Luminous Exitance (lm/m²)
Luminance (cd/m²) Luminance (cd/m²)
Luminous energy (talbot)Luminous energy (talbot)
Luminous power (lm=talbot/sec)Luminous power (lm=talbot/sec)
Illuminance (lm/ m²)Illuminance (lm/ m²)
Luminous Exitance (lm/m²)Luminous Exitance (lm/m²)
Luminance (cd/m²) Luminance (cd/m²)
In Computer Graphics both are used! In Computer Graphics both are used! In Computer Graphics both are used! In Computer Graphics both are used!
**W=watt, m=meter, sr=steradian, lm=lumen, cd=candelaW=watt, m=meter, sr=steradian, lm=lumen, cd=candela**W=watt, m=meter, sr=steradian, lm=lumen, cd=candelaW=watt, m=meter, sr=steradian, lm=lumen, cd=candela
PhotoreceptorsPhotoreceptors
RodsRods• Occupy the peripheral retina Occupy the peripheral retina
• Responsible for detection of movements, Responsible for detection of movements, shapes and night time vision shapes and night time vision
ConesCones• Responsible for fine detail and color vision.Responsible for fine detail and color vision.
• Occupy a small portion of the retina (macula)Occupy a small portion of the retina (macula)
• Three subtypes - Red, Blue and GreenThree subtypes - Red, Blue and Green
RodsRods• Occupy the peripheral retina Occupy the peripheral retina
• Responsible for detection of movements, Responsible for detection of movements, shapes and night time vision shapes and night time vision
ConesCones• Responsible for fine detail and color vision.Responsible for fine detail and color vision.
• Occupy a small portion of the retina (macula)Occupy a small portion of the retina (macula)
• Three subtypes - Red, Blue and GreenThree subtypes - Red, Blue and Green
Photoreceptor Photoreceptor sensitivitysensitivity
Red, green & blue cones are sensitive to
different frequencies
of light (guess which!)
Red, green & blue cones are sensitive to
different frequencies
of light (guess which!)
445445 535535 570570
RedRed
BlueBlue
GreenGreen
Sen
siti
vity
of
a si
ngl
e R
GB
con
e
Photoreceptor Photoreceptor sensitivitysensitivityA great image from the Architectural Science Lab A great image from the Architectural Science Lab
at the Univ. of Western Australia, showing the at the Univ. of Western Australia, showing the three characteristic peaks of sensitivity within the three characteristic peaks of sensitivity within the red/orange, green and blue frequency bandsred/orange, green and blue frequency bands
A great image from the Architectural Science Lab A great image from the Architectural Science Lab at the Univ. of Western Australia, showing the at the Univ. of Western Australia, showing the three characteristic peaks of sensitivity within the three characteristic peaks of sensitivity within the red/orange, green and blue frequency bandsred/orange, green and blue frequency bands
Human visual systemHuman visual system
What to take away from this discussionWhat to take away from this discussion• The basic system of image formationThe basic system of image formation
• The basis for the RGB computer color model The basis for the RGB computer color model is the is the tristimulus theorytristimulus theory of vision based on the of vision based on the sensitivity curvessensitivity curves
• That there is a lot of processing after an image That there is a lot of processing after an image is formed that we will not (cannot) modelis formed that we will not (cannot) model
What to take away from this discussionWhat to take away from this discussion• The basic system of image formationThe basic system of image formation
• The basis for the RGB computer color model The basis for the RGB computer color model is the is the tristimulus theorytristimulus theory of vision based on the of vision based on the sensitivity curvessensitivity curves
• That there is a lot of processing after an image That there is a lot of processing after an image is formed that we will not (cannot) modelis formed that we will not (cannot) model
Pinhole cameraPinhole camera
Simplistic modelSimplistic model- box with small hole on one sidebox with small hole on one side- hole allows only one ray of light to enterhole allows only one ray of light to enter
Simplistic modelSimplistic model- box with small hole on one sidebox with small hole on one side- hole allows only one ray of light to enterhole allows only one ray of light to enter
d is the distance to the image
plane
d is the distance to the image
plane
center at origin
center at origin
Pinhole cameraPinhole camera
• Align the distance to the image Align the distance to the image plane along the plane along the zz axis, giving axis, giving zz = - = -dd
• Find the Find the image pointimage point using similar triangles using similar trianglesyypp/-/-d d = = yy//z,z, or or yypp= -= -ydyd//zz
xxpp/-/-d d = = xx//z,z, or or xxpp= -= -xdxd//zz
• Align the distance to the image Align the distance to the image plane along the plane along the zz axis, giving axis, giving zz = - = -dd
• Find the Find the image pointimage point using similar triangles using similar trianglesyypp/-/-d d = = yy//z,z, or or yypp= -= -ydyd//zz
xxpp/-/-d d = = xx//z,z, or or xxpp= -= -xdxd//zz The point (xp,yp,,d) is
the projection point of (x,y,z)
The point (xp,yp,,d) is
the projection point of (x,y,z)
Pinhole cameraPinhole camera
• The The field of viewfield of view (or angle), (or angle), , , is is the angle made by the largest object whose the angle made by the largest object whose projection will fit on the view planeprojection will fit on the view plane
• The The field of viewfield of view (or angle), (or angle), , , is is the angle made by the largest object whose the angle made by the largest object whose projection will fit on the view planeprojection will fit on the view plane
= 2 tan-1 h/2d = 2 tan-1 h/2d
Pinhole cameraPinhole camera
• The The depth of fielddepth of field is the distance is the distance from the lens that an object is in focusfrom the lens that an object is in focus
• In a pinhole camera, the depth of field is In a pinhole camera, the depth of field is infinite (a perfect lens!), but there is little light infinite (a perfect lens!), but there is little light (an exception is sunlight) so images are dark(an exception is sunlight) so images are dark
• If we replace the pinhole with a lensIf we replace the pinhole with a lens- we can capture brighter imageswe can capture brighter images- we can vary the we can vary the focal lengthfocal length, d, which in turns , d, which in turns
changes the changes the field of viewfield of view (the zoom of a camera), (the zoom of a camera), which affects the which affects the depth of fielddepth of field
• The The depth of fielddepth of field is the distance is the distance from the lens that an object is in focusfrom the lens that an object is in focus
• In a pinhole camera, the depth of field is In a pinhole camera, the depth of field is infinite (a perfect lens!), but there is little light infinite (a perfect lens!), but there is little light (an exception is sunlight) so images are dark(an exception is sunlight) so images are dark
• If we replace the pinhole with a lensIf we replace the pinhole with a lens- we can capture brighter imageswe can capture brighter images- we can vary the we can vary the focal lengthfocal length, d, which in turns , d, which in turns
changes the changes the field of viewfield of view (the zoom of a camera), (the zoom of a camera), which affects the which affects the depth of fielddepth of field
Synthetic camera modelSynthetic camera model
The camera system we’ll use in CG isThe camera system we’ll use in CG is
analogous to the other imaging systemsanalogous to the other imaging systems• The The focal lengthfocal length determines the projection determines the projection
plane (the image plane), e.g. the plane z = -10plane (the image plane), e.g. the plane z = -10
• The image is The image is projectedprojected point by point onto the point by point onto the projection planeprojection plane
• The The field of viewfield of view is simulated using a clipping is simulated using a clipping window, or frustumwindow, or frustum
• Depth of fieldDepth of field is more difficult to simulate is more difficult to simulate
The camera system we’ll use in CG isThe camera system we’ll use in CG is
analogous to the other imaging systemsanalogous to the other imaging systems• The The focal lengthfocal length determines the projection determines the projection
plane (the image plane), e.g. the plane z = -10plane (the image plane), e.g. the plane z = -10
• The image is The image is projectedprojected point by point onto the point by point onto the projection planeprojection plane
• The The field of viewfield of view is simulated using a clipping is simulated using a clipping window, or frustumwindow, or frustum
• Depth of fieldDepth of field is more difficult to simulate is more difficult to simulate
How shall we model How shall we model light?light?
Particle model at large scaleParticle model at large scale• Geometrical opticsGeometrical optics
• RadiometryRadiometry
Wave model at small scaleWave model at small scale• Physical opticsPhysical optics
• Maxwell’s equationsMaxwell’s equations
Particle model at large scaleParticle model at large scale• Geometrical opticsGeometrical optics
• RadiometryRadiometry
Wave model at small scaleWave model at small scale• Physical opticsPhysical optics
• Maxwell’s equationsMaxwell’s equations
APIsAPIs
Application programApplication program
Graphics library(API)
Graphics library(API)
HardwareHardware
Application programming interfaces (APIs) shield usersfrom implementation details
DisplayDisplay
OpenGL, PHIGS, Direct3D,VRML, and Java3D are all
graphics APIs
OpenGLOpenGL
For a synthetic camera model, OpenGLFor a synthetic camera model, OpenGL
API functions must allow user to specify:API functions must allow user to specify:• Objects Objects
- polygons, points, spheres, curves, surfacespolygons, points, spheres, curves, surfaces- code that defines a polygon in OpenGLcode that defines a polygon in OpenGL
For a synthetic camera model, OpenGLFor a synthetic camera model, OpenGL
API functions must allow user to specify:API functions must allow user to specify:• Objects Objects
- polygons, points, spheres, curves, surfacespolygons, points, spheres, curves, surfaces- code that defines a polygon in OpenGLcode that defines a polygon in OpenGL
Object Type
XYZ coordinatesof the 3D points
glBegin(GL_POLYGON); glVertex3f(0.0, 0.0, 0.0); glVertex3f(0.0, 1.0, 0.0); glVertex3f(0.0, 0.0, 1.0);glEnd(GL_POLYGON);
OpenGLOpenGL
Note:Note:• Both modeling and rendering can be Both modeling and rendering can be
performed in OpenGLperformed in OpenGL
• Often, the two are separate, and performed by Often, the two are separate, and performed by different applications, ie. AutoCAD (modeler) different applications, ie. AutoCAD (modeler) and Lightscape (renderer)and Lightscape (renderer)
• Rendering packages typically take as input the Rendering packages typically take as input the output of the popular CAD modelersoutput of the popular CAD modelers
Note:Note:• Both modeling and rendering can be Both modeling and rendering can be
performed in OpenGLperformed in OpenGL
• Often, the two are separate, and performed by Often, the two are separate, and performed by different applications, ie. AutoCAD (modeler) different applications, ie. AutoCAD (modeler) and Lightscape (renderer)and Lightscape (renderer)
• Rendering packages typically take as input the Rendering packages typically take as input the output of the popular CAD modelersoutput of the popular CAD modelers
OpenGLOpenGL
For a synthetic camera model, OpenGLFor a synthetic camera model, OpenGL
API functions must allow user to specify: API functions must allow user to specify: • Viewer (Camera)Viewer (Camera)
- see figure 1.23 on p. 23 in textbooksee figure 1.23 on p. 23 in textbook- position, orientation, focal lengthposition, orientation, focal length
• Light sourcesLight sources- location, color, direction, strengthlocation, color, direction, strength
• Material propertiesMaterial properties- color, transparency, reflectivity, smoothness, etc.color, transparency, reflectivity, smoothness, etc.
For a synthetic camera model, OpenGLFor a synthetic camera model, OpenGL
API functions must allow user to specify: API functions must allow user to specify: • Viewer (Camera)Viewer (Camera)
- see figure 1.23 on p. 23 in textbooksee figure 1.23 on p. 23 in textbook- position, orientation, focal lengthposition, orientation, focal length
• Light sourcesLight sources- location, color, direction, strengthlocation, color, direction, strength
• Material propertiesMaterial properties- color, transparency, reflectivity, smoothness, etc.color, transparency, reflectivity, smoothness, etc.
Pipeline architecturePipeline architecture
PipelinesPipelines• Data goes to processing step a, the resulting Data goes to processing step a, the resulting
data is passed to processing step b, and so ondata is passed to processing step b, and so on
MotivationMotivation• Raster displays become universalRaster displays become universal
• In CG, the exact same operations are In CG, the exact same operations are performed on millions of vertices per sceneperformed on millions of vertices per scene
Four major stepsFour major steps• Transform Transform (4)(4), clip , clip (7)(7), project , project (5)(5), rasterize, rasterize(7)(7)
PipelinesPipelines• Data goes to processing step a, the resulting Data goes to processing step a, the resulting
data is passed to processing step b, and so ondata is passed to processing step b, and so on
MotivationMotivation• Raster displays become universalRaster displays become universal
• In CG, the exact same operations are In CG, the exact same operations are performed on millions of vertices per sceneperformed on millions of vertices per scene
Four major stepsFour major steps• Transform Transform (4)(4), clip , clip (7)(7), project , project (5)(5), rasterize, rasterize(7)(7)
Rendering pipelineRendering pipeline
Modeling coordsModeling coords• modeling transformmodeling transform
World coords (object space)World coords (object space)• visability determination visability determination
• lightinglighting
• viewing transformviewing transform
View coords (eye space)View coords (eye space)• clip to hither and yonclip to hither and yon
• projection transformprojection transform
Modeling coordsModeling coords• modeling transformmodeling transform
World coords (object space)World coords (object space)• visability determination visability determination
• lightinglighting
• viewing transformviewing transform
View coords (eye space)View coords (eye space)• clip to hither and yonclip to hither and yon
• projection transformprojection transform
Rendering pipelineRendering pipeline
Normalized device coords (clip space)Normalized device coords (clip space)• clip to left,right,top,bottomclip to left,right,top,bottom
• scale and translate (workstation transform)scale and translate (workstation transform)
Device (screen) coords (image space)Device (screen) coords (image space)• hidden surface removalhidden surface removal
• rasterizationrasterization
DisplayDisplay
Normalized device coords (clip space)Normalized device coords (clip space)• clip to left,right,top,bottomclip to left,right,top,bottom
• scale and translate (workstation transform)scale and translate (workstation transform)
Device (screen) coords (image space)Device (screen) coords (image space)• hidden surface removalhidden surface removal
• rasterizationrasterization
DisplayDisplay