34
BPC: Art and Computation – Summer BPC: Art and Computation – Summer 2007 2007 Computer Graphics Computer Graphics Principles Principles Erik Brisson [email protected]

BPC: Art and Computation – Summer 2007 Computer Graphics Principles Erik Brisson [email protected]

  • View
    220

  • Download
    2

Embed Size (px)

Citation preview

Page 1: BPC: Art and Computation – Summer 2007 Computer Graphics Principles Erik Brisson ebrisson@bu.edu

BPC: Art and Computation – Summer 2007BPC: Art and Computation – Summer 2007

Computer Graphics PrinciplesComputer Graphics Principles

Erik Brisson

[email protected]

Page 2: BPC: Art and Computation – Summer 2007 Computer Graphics Principles Erik Brisson ebrisson@bu.edu

BPC: Art and Computation – Summer 2007 2

Computer GraphicsComputer Graphics

Basic paradigmModelingTransformationsLighting and shadingScan conversionTexture mappingAlternative rendering methods

Page 3: BPC: Art and Computation – Summer 2007 Computer Graphics Principles Erik Brisson ebrisson@bu.edu

BPC: Art and Computation – Summer 2007 3

C.G. paradigm with lightC.G. paradigm with light

Page 4: BPC: Art and Computation – Summer 2007 Computer Graphics Principles Erik Brisson ebrisson@bu.edu

BPC: Art and Computation – Summer 2007 4

Model geometry – two cuboidsModel geometry – two cuboids

Page 5: BPC: Art and Computation – Summer 2007 Computer Graphics Principles Erik Brisson ebrisson@bu.edu

BPC: Art and Computation – Summer 2007 5

Model geometry - approximationModel geometry - approximation

Page 6: BPC: Art and Computation – Summer 2007 Computer Graphics Principles Erik Brisson ebrisson@bu.edu

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]

Page 7: BPC: Art and Computation – Summer 2007 Computer Graphics Principles Erik Brisson ebrisson@bu.edu

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

Page 8: BPC: Art and Computation – Summer 2007 Computer Graphics Principles Erik Brisson ebrisson@bu.edu

BPC: Art and Computation – Summer 2007 8

Rigid body transformationsRigid body transformations

Page 9: BPC: Art and Computation – Summer 2007 Computer Graphics Principles Erik Brisson ebrisson@bu.edu

BPC: Art and Computation – Summer 2007 9

Composition of transformationsComposition of transformations

Rotate firstRotate firstThen translateThen translate

Translate firstTranslate firstThen rotateThen rotate

Page 10: BPC: Art and Computation – Summer 2007 Computer Graphics Principles Erik Brisson ebrisson@bu.edu

BPC: Art and Computation – Summer 2007 10

Other transformations - scalingOther transformations - scaling

Page 11: BPC: Art and Computation – Summer 2007 Computer Graphics Principles Erik Brisson ebrisson@bu.edu

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] … …

Page 12: BPC: Art and Computation – Summer 2007 Computer Graphics Principles Erik Brisson ebrisson@bu.edu

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)

Page 13: BPC: Art and Computation – Summer 2007 Computer Graphics Principles Erik Brisson ebrisson@bu.edu

BPC: Art and Computation – Summer 2007 13

Rotations in 3DRotations in 3D

Page 14: BPC: Art and Computation – Summer 2007 Computer Graphics Principles Erik Brisson ebrisson@bu.edu

BPC: Art and Computation – Summer 2007 14

C.G. paradigm with lightC.G. paradigm with light

Page 15: BPC: Art and Computation – Summer 2007 Computer Graphics Principles Erik Brisson ebrisson@bu.edu

BPC: Art and Computation – Summer 2007 15

C.G. basic calculationC.G. basic calculation

Page 16: BPC: Art and Computation – Summer 2007 Computer Graphics Principles Erik Brisson ebrisson@bu.edu

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)

Page 17: BPC: Art and Computation – Summer 2007 Computer Graphics Principles Erik Brisson ebrisson@bu.edu

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

Page 18: BPC: Art and Computation – Summer 2007 Computer Graphics Principles Erik Brisson ebrisson@bu.edu

BPC: Art and Computation – Summer 2007 18

Shading at vertices, interpolationShading at vertices, interpolation

Page 19: BPC: Art and Computation – Summer 2007 Computer Graphics Principles Erik Brisson ebrisson@bu.edu

BPC: Art and Computation – Summer 2007 19

Flat shading vs Gouraud shadingFlat shading vs Gouraud shading

Page 20: BPC: Art and Computation – Summer 2007 Computer Graphics Principles Erik Brisson ebrisson@bu.edu

BPC: Art and Computation – Summer 2007 20

ShadingShadingambient

diffuse

specular

Page 21: BPC: Art and Computation – Summer 2007 Computer Graphics Principles Erik Brisson ebrisson@bu.edu

BPC: Art and Computation – Summer 2007 21

Ray tracingRay tracing

Page 22: BPC: Art and Computation – Summer 2007 Computer Graphics Principles Erik Brisson ebrisson@bu.edu

BPC: Art and Computation – Summer 2007 22

Scan-conversion of polygonScan-conversion of polygon

Page 23: BPC: Art and Computation – Summer 2007 Computer Graphics Principles Erik Brisson ebrisson@bu.edu

BPC: Art and Computation – Summer 2007 23

C.G. concept - texture mapC.G. concept - texture map

Page 24: BPC: Art and Computation – Summer 2007 Computer Graphics Principles Erik Brisson ebrisson@bu.edu

BPC: Art and Computation – Summer 2007 24

Texture mappingTexture mapping

++

Page 25: BPC: Art and Computation – Summer 2007 Computer Graphics Principles Erik Brisson ebrisson@bu.edu

BPC: Art and Computation – Summer 2007 25

Resulting imageResulting image

Page 26: BPC: Art and Computation – Summer 2007 Computer Graphics Principles Erik Brisson ebrisson@bu.edu

BPC: Art and Computation – Summer 2007 26

Result is a digital imageResult is a digital image

Page 27: BPC: Art and Computation – Summer 2007 Computer Graphics Principles Erik Brisson ebrisson@bu.edu

BPC: Art and Computation – Summer 2007 27

The quest for photorealismThe quest for photorealism

Page 28: BPC: Art and Computation – Summer 2007 Computer Graphics Principles Erik Brisson ebrisson@bu.edu

BPC: Art and Computation – Summer 2007 28

Alternative rendering techniquesAlternative rendering techniques

Page 29: BPC: Art and Computation – Summer 2007 Computer Graphics Principles Erik Brisson ebrisson@bu.edu

BPC: Art and Computation – Summer 2007 29

Alternative rendering techniquesAlternative rendering techniques

Page 30: BPC: Art and Computation – Summer 2007 Computer Graphics Principles Erik Brisson ebrisson@bu.edu

BPC: Art and Computation – Summer 2007 30

3D object photography3D object photography

http://www.royalalbertamuseum.ca/vexhibit/virtcoll/index.asp

Page 31: BPC: Art and Computation – Summer 2007 Computer Graphics Principles Erik Brisson ebrisson@bu.edu

BPC: Art and Computation – Summer 2007 31

Panoramic photographyPanoramic photography

Page 32: BPC: Art and Computation – Summer 2007 Computer Graphics Principles Erik Brisson ebrisson@bu.edu

BPC: Art and Computation – Summer 2007 32

Other techniquesOther techniques

Page 33: BPC: Art and Computation – Summer 2007 Computer Graphics Principles Erik Brisson ebrisson@bu.edu

BPC: Art and Computation – Summer 2007 33

Other techniques, laser scanningOther techniques, laser scanning

Page 34: BPC: Art and Computation – Summer 2007 Computer Graphics Principles Erik Brisson ebrisson@bu.edu

BPC: Art and Computation – Summer 2007 34

Now we can model, transform, Now we can model, transform, illuminate, and render doughnutsilluminate, and render doughnuts