電腦圖學 Computer Graphics
課程大綱 教科書 Hong Zhang and Y. Daniel Liang, “Computer Graphics Using Java 2D and 3D,” Pearson Prentice Hall, 2007 ( 全華代理 ) 參考書 1.OpenGL Programming Guide, Addison-Wesley, OpenGL Reference Manual, Addison-Wesley, Richard Wright and Michael Sweet, “OpenGL Super Bible (2nd Edition),” Waite Group Press, P. Schneider and D. Eberly, Geometric Tools for Computer Graphics, Morgan Kaufmann, F.S. Hill, Jr, “Computer Graphics Using OpenGL (2nd Edition),” Prentice-Hall, ( 歐亞代理 ) 6.Foley and Hughes, “Computer Graphics, Principles and Practice,” Addison-Wesley, ( 新月代理 ) 7.Alan Watt, “3D Computer Graphics,” 2000, Addison Wesley ( 新月代理 ) 8.Edward Angel, Interactive Computer Graphics – A Top Down Approach Using OpenGL (3rd Edition), Addison-Wesley, ( 開發代理 )
課程大綱 (continued) 1. Introduction: computer graphics, graphics architectures and software, imaging, camera vs. human-vision models, synthetic camera, modeling and rendering 2. OpenGL: basics and simple windows programming 3. Color: color perception, color models (RGB, CMY, etc.), indexed color 4. Input: input devices, client-server computing, interactions 5. Geometric Transformations: affine transformations, coordinate transformations 6. Three Dimensional Graphics: viewing, projection, transformation, 3-D architectures 7. Rendering: hidden surface removal, illumination, surface modeling, shading 8. Modeling: hierarchical and object-oriented graphics 9. Survey of Advanced Topics: curves and surfaces, texture mapping, composition
成績評定標準 Quizzes & Homework 50% Midterm Exam 20% Projects & Presentations 30%
Homework #1 Write about your expectation from this class (approximately a half page of an A4 paper) Familiarize yourself with any 2D or 3D software applications (3D is preferable), such as 3D Studio, AutoCAD, Adobe Dimensions, Adobe Photoshop, Adobe Illustrator, Adobe Flash –Design 2D an 3D objects and generate special effects (animation is preferable). –Work as an individual. –Submit your artwork file (less than 20MB) by 9/21 with a PDF report describing step-by-step instructions to accomplish your job. Late submission will risk 5 point loss per day. –Your grade is determined by the following merits: 2D or 3D Clarity of the report Conformance of the due date policy
Computer Graphics (CG) Pictures generated by a computer Tools used to make pictures Field of study involving pictures and tools Our eye-brain system is highly attuned to recognizing visual patterns.
CG Usage (1/6) -- Graphics art design entertainment publishing
CG Usage (2/6) – Image Processing computer graphics vs. image processing
Computer Graphics vs. Image Processing Computer Graphics is concerned with all aspects of producing pictures or images using a computer. Image Processing manipulates existing images and is intended to generate information from the images.
CG Usage (3/6) -- Monitoring
CG Usage (4/6) – Display & Simulation
CG Usage (5/6) – CAD CAD: computer- aided design
CG Usage (6/6) Scientific analysis and visualization
OpenGL OpenGL is composed of graphical libraries that separate the programmers from the device-dependent display (or rendering) mechanism. Develop an OpenGL program on the Microsoft Windows Visual C or C++ platform: –Two basic executables: opengl32.dll and glu32.dll -- should already be in the system folder –Two basic lib files: opengl32.lib and glu32.lib -- should already be in the VC++ lib folder –Two header files: gl.h and glu.h should be in a folder under VC ’ s include –You will have to get glut32.lib, glut32.dll and glut.h offthe web. Check for more details. Put them in thesame places as the other files. –For time being, creaate a console-mode application –Project setting, so that VC knows where to find header files and libraries. –Build the executable and run.
Applications of Computer Graphics Display of Information –Floor plan, GIS (geography information system), CT (computed tomography), MRI (magnetic resonance imaging), PET (positron- emission tomography), Scientific visualization Design –CAD (computer-aided design), CAM (computer-aided manufacture) Simulation – VR (virtual reality), gaming User Interfaces – windowing system
繪圖系統的基本原件 (Edward Angel)
繪圖系統的基本原件 (Alan Watt)
Pixels (picture elements) (a) Image of Yeti the cat. (b) Detail of area around one eye showing individual pixels.
Terminology Frame buffer: where the pixels are stored in a part of memory Depth: the number of bits used for each pixel Resolution: the number of pixels in the frame buffer Rasterization or scan conversion: conversion from geometric entities to pixel assignments in the frame buffer Refresh rate Interlaced vs. non-interlaced RGB triad LCD (liquid-crystal display) Pointing devices
The Cathode-ray tube (CRT)
Shadow-mask CRT
Images: Physical vs. Synthetic Computer-generated images are synthetic or artificial Objects vs. Viewers Light and Surface –Light is a form of electromagnetic radiation –Visible spectrum (wavelengths 350~780 nm) –Point source vs. ambient source –Ambient, diffuse, specular coefficients
Images seen by three different viewers A’s view (upper right)B’s view (front) C’s view (side)
Camera System
A camera system with a light source
The electromagnetic spectrum
Scene with a single point source
Ray tracing Ray A goes directly through the lens, whereas ray B misses everything and travels to infinity. Ray C bounces off a mirror and enters the camera. Ray D hits a diffuse surface and generates (infinite) new rays that, in principle, can contribute to the image. Ray E hits a surface that is partially transparent, and generates a transmitted ray and a reflected ray. Ray F is reflected from a surface, but strikes another surface that absorbs it.
The human visual system lens: 水晶體 iris: 虹膜 cornea: 角膜 retina: 視網膜 optic nerve: 視覺神經 cone: photopic (bright-light) vision rod: scotopic (dim-light) vision
Wavelength of Light
Cone(Retina) sensitivity curves
Pinhole camera
Side view of pinhole camera
Angle of View or Field of View Disadvantages: (1) single ray from a point source; (2) camera is fixed
Imaging system
Equivalent views of image formation image formed on the back of the cameraImage plane in front of the camera
Imaging with the synthetic camera
Clipping Window in initial positionWindow shifted
Application programmer ’ s model of software API: application programmer’s interface Objects Viewer Light sources Material properties
Camera specification COP: center of projection Position Orientation Focal Length Film Plane
Two-point perspective of a cube
The modeling-rendering pipeline
Early graphics system
Display-processor architecture
Arithmetic pipeline
Geometric pipeline