An Introduction to Computer Graphics

An Introduction to Computer Graphics

An Introduction to Computer Graphics Joaquim Madeira Beatriz Sousa Santos Universidade de Aveiro L ë 1 Computer Graphics The technology with which pictures, in the broadest sense of the word, are Captured or generated, and presented Manipulated and / or processed Merged with other, non-graphical application data It includes: Integration with other kinds of data – Multimedia Advanced dialogue and interactive technologies [CG Topics – Darmstadt] 2 Computer Graphics Computer Graphics deals with all aspects of creating images with a computer Hardware Software Applications [Angel] 3 Computer Graphics: 1950 – 1960 Earliest days of computing Pen plotters Simple calligraphic displays Issues Cost of display refresh Slow, unreliable, expensive computers 4 Computer Graphics: 1960 – 1970 Wireframe graphics Draw only lines ! [Angel] 5 Computer Graphics: 1960 – 1970 Ivan Sutherland’s Sketchpad PhD thesis at MIT (1963) Man-machine interaction Processing loop Display something Wait for user input Generate new display [http://history-computer.com] 6 Computer Graphics: 1970 – 1980 Raster graphics Allows drawing polygons First graphics standards Workstations and PCs 7 Raster graphics Image produced as an array (the raster) of picture elements (pixels) in the frame buffer [Angel] 8 Raster graphics Drawing polygons Illumination models Shading methods [Angel] 9 Computer Graphics: 1980 – 1990 The quest for realism Smooth shading Environment mapping Bump mapping [Angel] 10 Computer Graphics: 1980 – 1990 Special purpose hardware Industry-based standards PHIGS RenderMan http://renderman.pixar.com/view/future-of-renderman Human-Computer Interaction 11 Computer Graphics: 1990 – 2000 OpenGL API First successful computer-generated feature- length animation film: Toy Story New hardware capabilities 12 Computer Graphics: 2000 – … Photorealism Graphics cards for PCs dominate the market Nvidia ATI Game boxes / players determine the market CG is routine in the film industry 13 Gouraud shading – 1971 [Wikipedia] 14 Gouraud shading Poor highlight Very high polygon count http://en.wikipedia.org/wiki/Gouraud_shading 15 Phong shading– 1973 [Wikipedia] 16 Phong reflection model – 1973 [Wikipedia] 17 Can you see the differences ? 18 Ray-Tracing example http://radsite.lbl.gov/radiance/book/img/plate10.jpg 19 “Vermeer’s Studio” Wallace & Cohen, 1987: Radiosity and Ray-Tracing 20 Another Ray-Tracing example http://www.tjhsst.edu/~dhyatt/superap/samplex.jpg 21 Radiosity Without radiosity With radiosity [Burdea] 22 Texture mapping Smooth shading Environment mapping Bump mapping [Angel] 23 Textures – Simulating Ray-Tracing [http://www.okino.com] Increased realism !! 11 light sources + 25 texture maps 24 CG – Application areas Entertainment Computer games Animation films Special effects Engineering / Architecture Computer-Aided Design (CAD) Data Visualization Medicine Visualization … 25 Games – Lara Croft 1996 2007 2013 [Wikipedia] 26 Animation films – Pixar Toy Story – 1995 Ratatouille – 2007 Toy Story – 2014 [www.pixar.com] 27 Animation films – Pixar Toy Story 3 – 2010 Brave – 2012 [www.pixar.com] 28 Special effects – ILM 1991 1994 1999 [Wikipedia] 29 Special effects – ILM 2005 2009 2013 [Wikipedia] 30 Computer-Aided Design CAD mockup [Wikipedia] 31 CAD – Simulation [Wikipedia] 32 Visualization Techniques / tools for creating Images Diagrams Animations … Aims Convey a message – Static Visualization ! Allow interactive exploration / analysis 33 ,irtual and Augmented Reality ,irtual Reality – examples Industry Jaguar/ Land Rover http://www.youtube.com/watch?v=j3qcnvgVlNk 35 http://www.youtube.com/watch?v=CMU0HtmBt48 36 Medicine http://www.youtube.com/ watch?v=zJmrcEM-uvA 37 0 tertainment Oculus Rift 2014; ~300 USD http://www.oculusvr.com/ http://www.youtube.com/watch?v=N8uuDT53A8 Yts CG is not alone… Visualization Core areas: IP HCI CG, IP, CV and HCI CG CV Satellite areas: Geometric Geometric Modeling Modeling Data and Information Visualization What is common? CG, IP : image file formats, color models, … CG, CV : 3D model representations, … IP, CV : noise removal, filters, … 39 CG is not alone… Visualization IP Geometric Modeling CG HCI CV : 3D scanning CV CG : 2D and 3D models Geometric Modeling HCI : interaction techniques Visualization HCI : interaction techniques GeoM : 2D and 3D models CG : rendering 40 Example – Medical Imaging Processing pipeline Noise removal Segmentation Generating 2D / 3D models Data visualization User interaction … [www.mevislab.de] RVA - 2014/2015 41 CG Main Tasks Modeling Construct individual models / objects Assemble them into a 2D or 3D scene Animation Static vs. dynamic scenes Movement and / or deformation Rendering Generate final images Where is the observer? How is he / she looking at the scene? 42 Basic Graphics System [Angel] Image formed in the frame buffer 43 Computer Graphics APIs Create 2D / 3D scenes from simple primitives OpenGL Rendering No modeling or interaction facilities Direct 3D – Microsoft VTK 3D CG + Image processing + Visualization … 44 API contents Functions for specifying / instantiating Geometric primitives Viewer / Camera Light sources Materials … Functions for simple user interaction Input from devices: mouse, keyboard, etc. 45 Geometric Primitives Simple primitives Points Line segments Polygons Geometric primitives Parametric curves / surfaces Cubes, spheres, cylinders, etc. 46 Camera specification Six degrees of freedom Position of lens center Lens Film size Orientation of film plane [Angel] 47 4ights and materials Types of light sources Point vs distributed light sources Spot lights Near and far sources Color properties Material properties Absorption: color properties Scattering: diffuse and specular Transparency 48 OpenGL Multi-platform API for rendering 2D and 3D computer graphics Interaction with the GPU to achieve hardware-accelerated rendering Application areas CAD Virtual reality Scientific and Information Visualization … 49 OpenGL OpenGL ES Subset for use in embedded systems and portable devices WebGL JavaScript API based on OpenGL ES 2.0 Rendering interactive 2D and 3D graphics on any compatible browser, without the use of plug-ins 50 OpenGL Primitives Set of points GL_POINTS Point coordinates Color Marker size Marker shape 51 OpenGL Primitives Line segments GL_LINES GL_LINE_STRIP and GL_LINE_LOOP Vertex coordinates Color Width Stipple 52 OpenGL Primitives Triangles GL_TRIANGLES GL_TRIANGLE_STRIP + GL_TRIANGLE_FAN Fill color and edge color Drawing mode General Polygons Define as sets of triangles 53 OpenGL Primitives [OpenGL – The Red Book] 54 2D Visualization Define a 2D scene in the world coordinate system Select a clipping window in the XOY plane The window contents will be displayed Select a viewport in the display The viewport displays the contents of the clipping window 55 2D Visualization 56 Clipping W indow to Viewport Mapping 57 Coordinate mapping 58 OpenGL Default definitions are mostly used! Square clipping window Corners: (-1, -1) and (+1, +1) Viewport occupies the whole display window Changes can be made: The viewport might occupy only part of the display window The clipping window can be larger or smaller Pay attention to the aspect ratios! 59 Basic 2D Transformations p = (x, y) original point p’ = (x’, y’) transformed point • Basic transformations: Vector notation - Translation Note: Some older books and libraries use a different notation: :each point is represented by a - Scaling line matrix P = [ x y ] - Rotation 60 Translation • It is a rigid body transformation (it does not deform the object) • To apply a translation to a line segment we need only to transform the end points • To apply a translation to a polygon we need only to transform the vertices 61 Translation • It is necessary to specify translations in x and y transformation matrix Rotation • To apply a rotation we need to specify: - a point (center of rotation) (xr,yr) - A rotation angle (positive - counter-clockwise) Positive rotation 63 Rotation around the origin • The simplest case: x’= r cos ( + ) = r cos cos – r sin sin y’= r sin ( + ) = r cos sin + r sin cos Polar coordenates of the original point: x = r cos r sin ( + ) y = r sin Replacing: x’ = x cos – y sin y´ = x sin + y cos r cos ( + ) 64 Scaling • Modifies the size of an object; we need to specify scaling factors: sx and sy x’ = x . sx y’ = y . sy Trasformation matrix Transforming a square into a larger square applying a P’ = S . P scaling sx=2, sy=2 2D Transformations Matrix representation Homogeneous coordinates !! Concatenation = Matrix products Complex transformations ? Decompose into a sequence of basic transformations 66 Homogeneous coordinates • Most applications involve sequences of transformations • For instance: - visualization transformations involve a sequence of translations and rotations to render an image of a scene - animations may imply that an object is rotated and translated between two consecutive frames • Homogeneous coordinates provide an efficient way to represent and apply sequences of transformations 67 It is possible to combine in a matrix the multiplying and additive terms if we use 3x3 matrices All transformations may be represented by multiplying matrices Each point is now represented by 3 coordinates ( x, y ) (xh, yh, h),h = 0 x = xh / h y = yh / h ( x.h, y.h, h) 68 2D Translation 69 2D Rotation r sin ( + ) r cos ( +

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    116 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us