Presentation on theme: "Lecture 1: Introduction and Background"— Presentation transcript:
1 Lecture 1: Introduction and Background Computer GraphicsLecture 1: Introduction and Background
2 Lecturer Details Dr. Walid Khedr, Ph.D. Web:Department of Information Technology
3 Main Topics Introduction Basic principles of two-dimensional graphics Drawing lines and curvesAreas, text and colorsBasic principles of three-dimensional graphicsModeling three-dimensional objectsVisible surface determinationIllumination and shadingSpecial effects and virtual reality
4 What is Computer Graphics In general sense, computer graphics is the process of producing a picture or Image using the computer.This includes applications that start form drawing simple graphs or line drawingsAnd ends with programs that involve complex mathematics and physics in the production of highly accurate images.Added to this is the capability to create a series of images that result in an animation.The purpose of this Course is to explore some of the basic ideas of realistic image generation.The goal then is the creation of an image by writing a program instead of taking a picture with a camera.The amount of pages that have been written about this topic in specialized graphics books and technical conference papers is considerable. A book of this size, therefore, cannot expect to give all of the details for the simulation of all the possible natural phenomena that can be included in an image. Rather, the intent of this book is to introduce those concepts that are critical components of realistic image generation or are the foundation on which current efforts are built.
5 Image TerminologyA Pixel: is shorthand for "picture element." and it is one location in an image, whether on the computer screen or in a printout.Gray Scale Pixels: Each pixel takes one value that indicates where in the range from black to white it is.Color Pixels: Each pixel will use three values to store the range of intensities for the red, green, and blue (RGB) components.Each of those values, whether for a gray scale or color image, can be expressed as either:A floating point number values between 0.0 and 1.0An integer range Most graphics systems use either one or two bytes per value i.e. zero to 255, or zero to 65,535.The alpha-channel: Indicates the transparency of the pixel
6 Image Terminology, Cont. The pixels of an image are organized into a two-dimensional grid that is called a frame buffer and is frequently used as a two-dimensional arrayGraphics hardware has enough memory to store multiple frame buffers, which is useful for animation and game programs (a process called double buffering)The goal of realistic image creation is to calculate a collection of pixel values that when viewed creates the impression of a picture.
8 The Rendering (Graphics) Pipeline There is a wide range of different applications of computer graphics, but there are common elements in all of these applications.They all begin with data and that data is then used to create (or "render") an image, which is then displayed on a computer screen.The process going from data to image is called the graphics pipeline
9 3D Rendering Pipeline Transform into 3D world coordinate system 3D Geometric PrimitivesModelingTransformationTransform into 3D world coordinate systemViewingTransformationLighting &TexturingProjectionTransformationClippingScanConversionImage
10 3D Rendering Pipeline Transform into 3D world coordinate system 3D Geometric PrimitivesModelingTransformationTransform into 3D world coordinate systemTransform into 3D camera coordinate systemDone with modeling transformationViewingTransformationLighting &TexturingProjectionTransformationClippingScanConversionImage
11 3D Rendering Pipeline Transform into 3D world coordinate system 3D Geometric PrimitivesModelingTransformationTransform into 3D world coordinate systemTransform into 3D camera coordinate systemDone with modeling transformationViewingTransformationIlluminate according to lighting and reflectanceApply texture mapsLighting &TexturingProjectionTransformationClippingScanConversionImage
12 3D Rendering Pipeline Transform into 3D world coordinate system 3D Geometric PrimitivesModelingTransformationTransform into 3D world coordinate systemTransform into 3D camera coordinate systemDone with modeling transformationViewingTransformationIlluminate according to lighting and reflectanceApply texture mapsLighting &TexturingProjectionTransformationTransform into 2D screen coordinate systemClippingScanConversionImage
13 3D Rendering Pipeline Transform into 3D world coordinate system 3D Geometric PrimitivesModelingTransformationTransform into 3D world coordinate systemTransform into 3D camera coordinate systemDone with modeling transformationViewingTransformationIlluminate according to lighting and reflectanceApply texture mapsLighting &TexturingProjectionTransformationTransform into 2D screen coordinate systemClippingClip primitives outside camera’s viewScanConversionImage
14 3D Rendering Pipeline Transform into 3D world coordinate system 3D Geometric PrimitivesModelingTransformationTransform into 3D world coordinate systemTransform into 3D camera coordinate systemDone with modeling transformationViewingTransformationIlluminate according to lighting and reflectanceApply texture mapsLighting &TexturingProjectionTransformationTransform into 2D screen coordinate systemClippingClip primitives outside camera’s viewScanConversionDraw pixels (includes texturing, hidden surface, ...)Image
15 3D Rendering Pipeline 3D 2D 3D Geometric Primitives Modeling TransformationViewingTransformationLighting &Texturing3DProjectionTransformationClipping2DScanConversionImage
16 The Rendering Pipeline: A Tour Modeling TransformIlluminateViewing TransformClipProjectRasterizeModel & Camera ParametersRendering PipelineFramebufferDisplay
17 The Parts You Know Modeling Transform Illuminate Viewing Transform ClipProjectRasterizeModel & Camera ParametersRendering PipelineFramebufferDisplay
18 The Rendering Pipeline Modeling TransformIlluminateViewing TransformClipProjectRasterizeModel & Camera ParametersRendering PipelineFramebufferDisplay
19 2-D Rendering: Rasterization Modeling TransformIlluminateViewing TransformClipProjectRasterizeModel & Camera ParametersRendering PipelineFramebufferDisplayWe’ll talk about this soon…
20 The Rendering Pipeline: 3-D Modeling TransformIlluminateViewing TransformClipProjectRasterizeModel & Camera ParametersRendering PipelineFramebufferDisplay
21 The Graphics Pipeline, Cont. In the case of realistic image generation, the three main stages for computer generated image are modeling, rendering, and display
22 ModelingBefore an image can be created, a model of the scene is developed.The model needs to give the details of each of the objectsShapeSimpleComplexParameters specifying the object's materialsThe object colorWhat the object is made OfWhether the object is shiny, transparent, etc.
23 RenderingRendering is the process of generating an image from a model, by means of computer programs.The rendering process includes:Geometric Transformations (Affine Transformations)ClippingScan ConversionIlluminationShading
24 Image DisplayOne issue with the display of an Image is differences with output capability/Each company that manufactures a computer monitor or a color printer uses unique components.CRT MonitorsLCD MonitorsPlasma MonitorsThose components differ in how they produce their output, which means that one image can appear differently when displayed on two different monitorsThis issue is called "color reproduction."This topic is complex and well beyond the scope of this course
25 Real Scene → ImageReal scene whose details/objects have to be modelled.
26 Real Scene → ImageModel of the scene: in which the objects of the real scene are represented by the available modelling techniques.The true geometry might only be approximated by the model.the bowl in the real scene can only be approximated by a semisphere.
27 Real Scene → ImageChoice of a view/part of the virtual world to be displayed.Clipping: Computation which objects are within the chosen view.Visibility considerations: Which objects in the clipping region are visible for the viewer, i.e. are not hidden from view by other objects?
32 Matrices Applications in many areas Rectangular array – 2D array Size ColoursmallmediumlargeXlargeBlack60100150120White254810Gray93140170Navy7594Red80
33 DefinitionsA matrix is a rectangular array of elements (usually numbers) arranged in rows and columns enclosed in brackets.Order of the matrix is the number of rows and columns. A is a 3×2 matrix, B is a 3×3 matrix C is a 4×1 matrix .Matrices are denoted by capital letters while their elements are written as lower case letters as in example C above.We refer to a particular element by using notation that refers to the row and column containing the element, i.e. a21=-1, b32 = 1, c21 = b.Two matrices A and B are said to be equal, written A = B, if they have the same order and aij = bij for every i and j.
34 Type of MatricesSquare matrix – a matrix with an equal number of rows and columns.Diagonal matrix – a square matrix with zeros everywhere except down the leading diagonal.Unit matrix (identity matrix) – a diagonal matrix with ones down the leading diagonal. The identity matrix is denoted with the letter I.
35 Type of Matrices (continue) Zero matrix – a matrix with zeros everywhere, denoted by O.Symmetric matrix – a square matrix whose (ij)th element is the same as the (ji)th element for all i and j.Row matrix (row vector) – a matrix with only one row, i.e. its order is 1×m.Column matrix (column vector) – a matrix with only one column, i.e. an n×1 matrix.
36 Matrix Addition and Subtraction If A and B are two n×m matrices thentheir sum C = A + B is the n×m matrix withcij = aij + bijtheir difference C = A - B is the n×m matrix withcij = aij - bijExamples:
37 Scalar Multiplication of Matrices If A is an n×m matrix and k is a real number, then the scalar multiple C = kA is the n×m matrix where cij = kaij .
38 The Transpose of a Matrix If A is a matrix then the transpose of A is the matrix At where atij = aji.
39 Matrix Multiplication If A is an n×m matrix and B is an m×p matrix then the product of A and B, C = AB, is an n×p matrixCij = (row i of A) × (column j of B)= ai1b1j + ai2b2j + ai3b3j + … ainbjp
40 PropertiesIf a, b are scalars and A, B, C are matrices of the same dimension (order) thenA + B = B + AA + (B + C) = (A + B) + Ca(bA) = (ab)A(a + b)A = aA + bAa(A + B) = aA + aBa(A - B) = aA - aBA + OA = A, and aO = O(A + B)t = At + Bt(A - B)t = At - Bt
41 PropertiesIf a, b are scalars and A, B, C are matrices of the same dimension (order) then assuming that the matrix dimensions are such that the products in each of the following are defined, then we have:AB ≠ BAA(BC) = (AB)C(A + B)C = AC + BCA(B + C) = AB + ACOA = O, AO = O(aA)(bB) = abABIA = AI = A(AB)T = BTAT
42 Inverse of a 2×2 Matrix Not all Matrices have an inverse. The Determinant – determines if a matrix has an inverse or not. If the determinant of a matrix A is zero then the matrix has no inverse.Example:
43 Inverse of a 2×2 MatrixIf A is a matrix then it is possible to find another matrix, called A-1, such that AA-1 = I or A-1A = I .Example:
44 Solution of Systems of Simultaneous Equations A x = bAx = b A-1Ax = A-1b x = A-1b
57 Length of a vector Norm of a vector Only interested on the direction and not in its length.So norm(v) has the same direction but length 1.
58 Inner (dot) product of two vectors The dot-product, denoted by v1 · v2 , is the angular relationship between two vectors:Normalizing each of the vectors v1 and v2 and then take the dot-product of the normalized vectors we find which is the angle between the two vectors.The dot product of a unit length vector with itself is 1.Vectors that are perpendicular to one another (called orthogonal) have a zero dot product.
59 Exercise Find the angle between vectors (3,7) and (-4,5). y x (-4,5)
60 Vector cross-product Properties: The cross-product, denoted by v1 × v2 , is the vector:v1×v2 is orthogonal to both v1 and v2, i.e. v1 and v2 form a plane and their cross product is normal to that plane.How to remember the formula:v1v2-v1×v2 = v2×v1v1v2v1×v2Properties:
61 Next LectureChapter 2: Basic principles of two-dimensional graphics
Your consent to our cookies if you continue to use this website.