CS 445 / 645 Introduction to Computer GraphicsShow Your Gang ColorsTriangle ArithmeticVector SpacesVector Spaces: Basis VectorsMatricesSlide 7Matrix TransformationsSlide 9Slide 10ScalingSlide 12Slide 132-D RotationSlide 15Slide 16TranslationHomogeneous CoordinatesSlide 19Slide 20Slide 21Total PictureComposing TransformationsMultiplication Order – Wrong WayMultuplication Order - CorrectCompositing MatricesSlide 27Slide 28Frame Buffers1-Bit Memory, Monochrome Display (Bitmap Display)3-Bit Color DisplayTrue Color DisplayColor Map Look-Up TablesPseudo colorRendering 3D ScenesThe Rendering PipelineRendering: TransformationsThe Rendering Pipeline: 3-DSlide 39Slide 40Slide 41Slide 42Slide 43Slide 44Slide 45Introducing OpenGLSlide 47CS 445 / 645Introduction to Computer GraphicsLecture 3Lecture 3Mathematical PrimitivesMathematical PrimitivesIntroduction to TransformationsIntroduction to TransformationsLecture 3Lecture 3Mathematical PrimitivesMathematical PrimitivesIntroduction to TransformationsIntroduction to TransformationsShow Your Gang ColorsUse hand to identify handednessUse hand to identify handedness•Point thumb, index finger, and middle finger in orthogonal Point thumb, index finger, and middle finger in orthogonal directionsdirections–Thumb = x-axisThumb = x-axis–Index = y-axisIndex = y-axis–Middle = z-axisMiddle = z-axis•Left and right hands correspond to left and right hand Left and right hands correspond to left and right hand coordinate systemscoordinate systemsUse hand to identify handednessUse hand to identify handedness•Point thumb, index finger, and middle finger in orthogonal Point thumb, index finger, and middle finger in orthogonal directionsdirections–Thumb = x-axisThumb = x-axis–Index = y-axisIndex = y-axis–Middle = z-axisMiddle = z-axis•Left and right hands correspond to left and right hand Left and right hands correspond to left and right hand coordinate systemscoordinate systemsTriangle ArithmeticConsider a triangle, (a, b, c)Consider a triangle, (a, b, c)•a,b,c = (x,y,z) tuplesa,b,c = (x,y,z) tuplesSurface area = sSurface area = saa = ½ * ||(b –a) X (c-a)|| = ½ * ||(b –a) X (c-a)||Unit normal = (1/2sUnit normal = (1/2saa) * (b-a) X (c-a)) * (b-a) X (c-a)Consider a triangle, (a, b, c)Consider a triangle, (a, b, c)•a,b,c = (x,y,z) tuplesa,b,c = (x,y,z) tuplesSurface area = sSurface area = saa = ½ * ||(b –a) X (c-a)|| = ½ * ||(b –a) X (c-a)||Unit normal = (1/2sUnit normal = (1/2saa) * (b-a) X (c-a)) * (b-a) X (c-a)acbVector SpacesA A linear combinationlinear combination of vectors results in a new vector: of vectors results in a new vector:vv = = 11vv11 + + 22vv22 + … + + … + nnvvnnIf the only set of scalars such thatIf the only set of scalars such that 11vv11 + + 22vv22 + … + + … + nnvvnn = = 00 is is 11 = = 22 = … = = … = 33 = = 00 then we say the vectors are then we say the vectors are linearly independentlinearly independentThe The dimensiondimension of a space is the greatest number of linearly of a space is the greatest number of linearly independent vectors possible in a vector setindependent vectors possible in a vector setFor a vector space of dimension n, any set of n linearly For a vector space of dimension n, any set of n linearly independent vectors form a independent vectors form a basisbasis A A linear combinationlinear combination of vectors results in a new vector: of vectors results in a new vector:vv = = 11vv11 + + 22vv22 + … + + … + nnvvnnIf the only set of scalars such thatIf the only set of scalars such that 11vv11 + + 22vv22 + … + + … + nnvvnn = = 00 is is 11 = = 22 = … = = … = 33 = = 00 then we say the vectors are then we say the vectors are linearly independentlinearly independentThe The dimensiondimension of a space is the greatest number of linearly of a space is the greatest number of linearly independent vectors possible in a vector setindependent vectors possible in a vector setFor a vector space of dimension n, any set of n linearly For a vector space of dimension n, any set of n linearly independent vectors form a independent vectors form a basisbasisVector Spaces: Basis VectorsGiven a basis for a vector space:Given a basis for a vector space:•Each vector in the space is a Each vector in the space is a uniqueunique linear combination of the basis linear combination of the basis vectorsvectors•The The coordinatescoordinates of a vector are the scalars from this linear of a vector are the scalars from this linear combinationcombination•If basis vectors are orthogonal and unit length:If basis vectors are orthogonal and unit length:–Vectors comprise Vectors comprise orthonormal basisorthonormal basis•Best-known example: Cartesian coordinatesBest-known example: Cartesian coordinates•Note that a given vector Note that a given vector vv will have different coordinates for different will have different coordinates for different basesbasesGiven a basis for a vector space:Given a basis for a vector space:•Each vector in the space is a Each vector in the space is a uniqueunique linear combination of the basis linear combination of the basis vectorsvectors•The The coordinatescoordinates of a vector are the scalars from this linear of a vector are the scalars from this linear combinationcombination•If basis vectors are orthogonal and unit length:If basis vectors are orthogonal and unit length:–Vectors comprise Vectors comprise orthonormal basisorthonormal basis•Best-known example: Cartesian coordinatesBest-known example: Cartesian coordinates•Note that a given vector Note that a given vector vv will have different coordinates for different will have different coordinates for different basesbasesMatricesBy convention, matrix By convention, matrix element element MMrcrc is located at is located at row r and column c:row r and column c:By convention, matrix By convention, matrix element element MMrcrc is located at is located at row r and column c:row r and column c:mnm2m12n22211n1211MMMMMMMMMM32vvvv1By (OpenGL) By (OpenGL) convention, vectors convention, vectors are columnsare columnsBy (OpenGL) By (OpenGL) convention, vectors convention, vectors are columnsare columnsMatricesMatrix-vector multiplication applies a linear
View Full Document