300 likes | 377 Views
Interactive Computer Graphics Introduction. James Gain and Edwin Blake Department of Computer Science University of Cape Town July 2002 jgain@cs.uct.ac.za. Map of the Lecture. Applications of Computer Graphics Graphics Systems Evolution of Computer Imagery Course Information Topics
E N D
Interactive Computer GraphicsIntroduction James Gain and Edwin Blake Department of Computer ScienceUniversity of Cape Town July 2002jgain@cs.uct.ac.za Collaborative Visual Computing Laboratory
Map of the Lecture • Applications of Computer Graphics • Graphics Systems • Evolution of Computer Imagery • Course Information • Topics • Practicals • Background Reading • Marks Interactive Computer Graphics Contents
Applications of ComputerGraphicsI • A driving force behind CG innovation • Display of Information • Floor plans in Architecture • Maps in GIS • Imaging in Medicine • Scientific and Financial Visualization • Digital Publishing • Design • Architecture • Mechanical Parts • VLSI Circuits Interactive Computer Graphics Contents
Applications of Computer Graphics II • Simulation • Virtual Reality Training (flight, surgery, etc.) • Robotics Research • Games • Special Effects and Animation for Film • User Interfaces • WIMP • Internet Browsers • Innovative Interfaces Interactive Computer Graphics Contents
A Graphics System • Elements of a CG System: • Processor, Memory, Frame Buffer • Input Devices, Output Devices Interactive Computer Graphics Contents
Pixels and the Frame Buffer • Raster (as opposed to vector) Display • Picture swept out in horizontal rows • Pixels (picture elements) • Squares of a uniform colour on a grid • Frame buffer • Memory store of pixels • Depth • Number of bits used for a pixel • True colour has >= 24 bits • Often use RGB, a combination of red, green, blue primaries • Rasterization (scan conversion) • converting geometric primitives (lines, polygons) to pixels Interactive Computer Graphics Contents
Output Devices • Cathode-Ray Tube (CRT) • Electron beam steered by deflection plates to strike and activate phosphors • Only emits for milliseconds and needs to be refreshed • Refresh Rate • Sufficlently high redisplay to avoid flicker • Interlacing displays odd and even rows alternately • Colour Displays • a triad of coloured phosphors • A shadow mask ensures only the correct phosphors are excited Interactive Computer Graphics Contents
Input Devices • Keyboard • Input characters • “QWERTY” originally designed to slow typists down • 2-D Locators: • Mouse, light pen, data tablet • 3-D Locators • Trackers, 3-D Mouse • Haptics (Force Feedback) • Phantom • Data can also be input from dials, switches, digital camera Interactive Computer Graphics Contents
A Sequence of Images I Wireframe Flat Shaded Interactive Computer Graphics Contents
A Sequence of Images II Textured Smooth Shaded Interactive Computer Graphics Contents
A Sequence of Images III Modelling: Set Operations Interactive Computer Graphics Contents
Final Image Interactive Computer Graphics Contents
Exercise: Realism • Question: Consider some recent computer animated films (Shrek, Toy Story 2, Final Fantasy, Ice Age). Which aspects do you feel where particularly realistic and which unrealistic? Try to name particular scenes. • Answer: Interactive Computer Graphics Contents
Image Formation • Combining objects and viewers to produce an image • Objects: • Exist independently of image formation • Constructed from geometric primitives (vertices) • Viewers: • Form the 2-D image of the objects from a particular perspective Interactive Computer Graphics Contents
Light and Images • Light interacts with objects and a portion enters the camera lense or eye • Visible light has wavelengths in the range 350-780 nm • CG often assumes point light sources that emit constant intensity light from a single location • CG often ignores the wave nature of light Interactive Computer Graphics Contents
Ray Tracing • Rays (semi-infinite lines) are traced from the light source. Some of them eventually strike the image plane • Light may be reflected, scattered or refracted as it strikes objects • Ray tracing is based on this principle but is (arguably) too computationally costly in many cases • A simple approximation is to assume uniform ambient light levels Interactive Computer Graphics Contents
Human Visual System • Cones: • Central high resolution colour • Three types, roughly r, g, b • Rods: • peripheral low resolution monochromatic • Visual acuity measures how closely two point can be placed and still distinguished • Respond differently to different wavelengths according to the CIE standard observer curve • Signal sent along optic nerves to visual cortex for very sophisticated high-level processing Interactive Computer Graphics Contents
The Synthetic Camera Model • Computer generated and optical (camera) image formation are equated • Image of a point is found by drawing a line from the point through the centre of projection of the lense onto the projection plane • CG moves the projection plane in front of the camera and uses a clipping window to limit the size of the image • Together the centre of projection, projection plane and clipping window define the image Interactive Computer Graphics Contents
Application Programmer’s Interface • Shield a programmer from the underlying hardware and software • Provide a system metaphor (the synthetic camera model) • Examples: OpenGL, PHIGS, Direct3D, Java-3D • API needs to allow specification of: • Objects • Viewer • Light Sources • Material Properties • OpenGL code for a triangle • glBegin(GL_POLYGON); glVertex3f(0.0, 0.0, 0.0); glVertex3f(0.0, 1.0, 0.0); glVertex3f(0.0, 0.0, 1.0); glEnd(); Interactive Computer Graphics Contents
The Modelling-Rendering Paradigm • Modelling of the scene can be separated from production of the image • Different requirements (modelling - interactive, rendering - high quality) • Objects are viewer independent • Leads to specialisation (e.g. RenderMan renderer and FreeForm modeller) • Dominant in CAD and SFX • Approach adopted in this course (rendering first half, modelling second half) Interactive Computer Graphics Contents
Graphics Architectures • For efficiency implement much of the graphics API in hardware • Display processors: • Unburden the host processor • Compile primitives as a display list rendered by the display processor • Pipeline Architectures: • Increases throughput where a sequence of identical operations are applied to a stream of data • Geometry has this property Interactive Computer Graphics Contents
Geometric Pipeline • Transformations: • Need to transform from object to camera to screen coordinates • Encoded as a 4x4 matrix • Clipping: • Limited field of view so cut geometry against the clipping rectangle • Projection: • Flatten objects from 3-D to 2-D • Rasterization: • Convert objects to pixels in the frame buffer • But need to balance latency (time for a single datum to pass) against throughput (rate at which datum are output) Interactive Computer Graphics Contents
Course Information • Interdisciplinary (little bits of physics, maths, psychology, engineering) • Sufficient to be an independent practitioner • 3rd period, Room 302 (alternates with CPL/PLT) • 30 lectures • Course information on the WWW: • www.cs.uct.ac.za/Courses/CS300W/IG • www.people.cs.uct.ac.za/~jgain/courses • Lecturers: • Dr James Gain (jgain@cs.uct.ac.za) • Prof Edwin Blake (edwin@cs.uct.ac.za) • Textbook: • “Interactive Computer Graphics: A Top-Down Approach with OpenGL” (2nd ed.), E. Angel, Addison-Wesley, 2000 Interactive Computer Graphics Contents
Topics • Introduction - ch. 1 • Graphics Programming (Basic OpenGL) - ch. 2 • Geometric Objects and Transformations - ch. 4 • Viewing - ch. 5 • Shading - ch. 6 • Implementation of a Renderer - ch. 7 • Hierarchical and Object-Oriented Graphics - ch. 8 • Input and Interaction - ch. 3 • Discrete Techniques - ch. 9 • Curves and Surfaces - ch. 10 • Procedural Methods - ch. 11 • Modelling - additional topic • Special Effects - additional topic Interactive Computer Graphics Contents
A Guide to Surviving the Mathematics • Contrary to expectations CG does not require advanced maths • Master the mathematics before the course (do exercise 0) • Mostly Linear Algebra • Vectors • addition • dot product, cross product • Line equations, plane equations, normals • Matrices, transformations • Curves and approximations • polynomials • circles, ellipses, parabolas • parameters, functions Interactive Computer Graphics Contents
Further Reading • The Graphics Bible: • “Computer Graphics: Principles and Practice” (2nd ed), J.D.Foley, S.K. Feiner, A. van Dam, J.F. Hughes, Addison-Wesley, 1996 • ACM Digital Library http://www.acm.org • Computer Bibliography Database • SIGGRAPH Conference Proceedings • Journals (Transactions on Graphics, etc) • IEEE Computer Society: http://www.computer.org • Computer Graphics and Applications Magazine • Transactions on Computer Graphics and Visualization • Eurographics: http://www.eg.org • Computer Graphics Forum Interactive Computer Graphics Contents
Practicals • Available on the WWW: www.cs.uct.ac.za/Courses/CS300W/IG/Assignments • 3 Practicals: • Shading: Glut, Phong & Gouraud Shading (3 weeks) • Scene Graph: OpenGL, CoordinateTransformations, Perspective (4 weeks) • Animation (3 weeks) • Time estimate depends on your knowing the material! • Tutor: • Matthew Hampton (mhampton@cs.uct.ac.za) • Copying: • All practicals must be entirely your own work • You may not copy from previous years Interactive Computer Graphics Contents
Mark Breakdown • 3 practicals, 1 test, 1 final exam • Practical work 35% • Class test 15% • Examination 50% • Final exam: • One and a half hours • Open Book • 1 compulsory question • choice of 2 out of 3 remaining Interactive Computer Graphics Contents
Hey, I want to do more Computer Graphics! Honours Visualization Advanced Graphics Useability Virtual Reality Image Processing Outside Small firms (WEB !) Further study overseas Masters — Collaborative Visual Computing Lab: Collaborative Virtual Environments; Computer Graphics; Cooperative Visualization; Usability and Human Computer Interaction Web-based applications; Medical Imaging Life After the Exam Interactive Computer Graphics Contents