View
220
Download
2
Tags:
Embed Size (px)
Citation preview
BPC: Art and Computation – Summer 2007BPC: Art and Computation – Summer 2007
Computer Graphics PrinciplesComputer Graphics Principles
Erik Brisson
BPC: Art and Computation – Summer 2007 2
Computer GraphicsComputer Graphics
Basic paradigmModelingTransformationsLighting and shadingScan conversionTexture mappingAlternative rendering methods
BPC: Art and Computation – Summer 2007 3
C.G. paradigm with lightC.G. paradigm with light
BPC: Art and Computation – Summer 2007 4
Model geometry – two cuboidsModel geometry – two cuboids
BPC: Art and Computation – Summer 2007 5
Model geometry - approximationModel geometry - approximation
BPC: Art and Computation – Summer 2007 6
Math representationMath representationVerticesVertices P1 = (4.0, 2.0)P1 = (4.0, 2.0) P2 = (2.0, 2.0)P2 = (2.0, 2.0) P3 = (2.0, 4.0)P3 = (2.0, 4.0) P4 = (4.0, 4.0)P4 = (4.0, 4.0) P5 = (6.0, 3.0)P5 = (6.0, 3.0) P6 = (4.0, 1.0)P6 = (4.0, 1.0) P7 = (7.0, 1.0)P7 = (7.0, 1.0) P8 = (8.0, 2.0)P8 = (8.0, 2.0)Faces:Faces: F1 = [P1, P2, P3, P4]F1 = [P1, P2, P3, P4] F2 = [P1, P4, P5]F2 = [P1, P4, P5] F3 = [P7, P6, P1, P5, P8]F3 = [P7, P6, P1, P5, P8]
BPC: Art and Computation – Summer 2007 7
Computer representationComputer representationVerticesVertices 1: 4.0, 2.01: 4.0, 2.0 2: 2.0, 2.02: 2.0, 2.0 3: 2.0, 4.03: 2.0, 4.0 4: 4.0, 4.04: 4.0, 4.0 5: 6.0, 3.05: 6.0, 3.0 6: 4.0, 1.06: 4.0, 1.0 7: 7.0, 1.07: 7.0, 1.0 8: 8.0, 2.08: 8.0, 2.0Faces:Faces: 1: 1, 2, 3, 41: 1, 2, 3, 4 2: 1, 4, 52: 1, 4, 5 3: 7, 6, 1, 5, 83: 7, 6, 1, 5, 8
BPC: Art and Computation – Summer 2007 8
Rigid body transformationsRigid body transformations
BPC: Art and Computation – Summer 2007 9
Composition of transformationsComposition of transformations
Rotate firstRotate firstThen translateThen translate
Translate firstTranslate firstThen rotateThen rotate
BPC: Art and Computation – Summer 2007 10
Other transformations - scalingOther transformations - scaling
BPC: Art and Computation – Summer 2007 11
Objects in 3DObjects in 3DVerticesVertices P1 = (0.0, 0.0, 2.7)P1 = (0.0, 0.0, 2.7) P2 = (1.0, 0.0, 0.5)P2 = (1.0, 0.0, 0.5) P3 = (0.998, 0.156, 0.5)P3 = (0.998, 0.156, 0.5) P4 = (0.951, 0.309, 0.5)P4 = (0.951, 0.309, 0.5) P5 = (0.891, 0.454, 0.5)P5 = (0.891, 0.454, 0.5) … …
Faces:Faces: F1 = [P1, P2, P3]F1 = [P1, P2, P3] F2 = [P1, P3, P4]F2 = [P1, P3, P4] F3 = [P1, P4, P5]F3 = [P1, P4, P5] … …
BPC: Art and Computation – Summer 2007 12
Transformations in 3DTransformations in 3DSphereSphere translated bytranslated by (-3.0, 2.0, -4.5)(-3.0, 2.0, -4.5) Blue cubeBlue cube translated bytranslated by (2.0, 0.0, -4.0)(2.0, 0.0, -4.0) rotated 60 degrotated 60 deg around y-axisaround y-axis
Purple cubePurple cube translated bytranslated by (0.0, 0.0, 0.0)(0.0, 0.0, 0.0)
BPC: Art and Computation – Summer 2007 13
Rotations in 3DRotations in 3D
BPC: Art and Computation – Summer 2007 14
C.G. paradigm with lightC.G. paradigm with light
BPC: Art and Computation – Summer 2007 15
C.G. basic calculationC.G. basic calculation
BPC: Art and Computation – Summer 2007 16
Lighting - vectorsLighting - vectors
V_eye = P_eye - PV_light = P_light - P
V_eye = (4, 1, 10) - (5, 2, 3) = (-1, -1, 7)V_light = (3, 7, 2) – (5, 2, 3) = (-2, 5, -1)
BPC: Art and Computation – Summer 2007 17
Unit shading vectorsUnit shading vectors
n = surface normal vectoru_light = unit vector to light pointu_eye = unit vector to view point
BPC: Art and Computation – Summer 2007 18
Shading at vertices, interpolationShading at vertices, interpolation
BPC: Art and Computation – Summer 2007 19
Flat shading vs Gouraud shadingFlat shading vs Gouraud shading
BPC: Art and Computation – Summer 2007 20
ShadingShadingambient
diffuse
specular
BPC: Art and Computation – Summer 2007 21
Ray tracingRay tracing
BPC: Art and Computation – Summer 2007 22
Scan-conversion of polygonScan-conversion of polygon
BPC: Art and Computation – Summer 2007 23
C.G. concept - texture mapC.G. concept - texture map
BPC: Art and Computation – Summer 2007 24
Texture mappingTexture mapping
++
BPC: Art and Computation – Summer 2007 25
Resulting imageResulting image
BPC: Art and Computation – Summer 2007 26
Result is a digital imageResult is a digital image
BPC: Art and Computation – Summer 2007 27
The quest for photorealismThe quest for photorealism
BPC: Art and Computation – Summer 2007 28
Alternative rendering techniquesAlternative rendering techniques
BPC: Art and Computation – Summer 2007 29
Alternative rendering techniquesAlternative rendering techniques
BPC: Art and Computation – Summer 2007 30
3D object photography3D object photography
http://www.royalalbertamuseum.ca/vexhibit/virtcoll/index.asp
BPC: Art and Computation – Summer 2007 31
Panoramic photographyPanoramic photography
BPC: Art and Computation – Summer 2007 32
Other techniquesOther techniques
BPC: Art and Computation – Summer 2007 33
Other techniques, laser scanningOther techniques, laser scanning
BPC: Art and Computation – Summer 2007 34
Now we can model, transform, Now we can model, transform, illuminate, and render doughnutsilluminate, and render doughnuts