Java程序辅导

C C++ Java Python Processing编程在线培训 程序编写 软件开发 视频讲解

客服在线QQ:2653320439 微信:ittutor Email:itutor@qq.com
wx: cjtutor
QQ: 2653320439
TOPICS in IT: 
ADVANCED GRAPHICS 
(CS & SE 233.420)
Dr. Karen Haines
Email: karen@csse.uwa.edu.au
Office Hours: by appointment
Lab: Tue, 10:00 am - 12:00 pm 
CS & SE 2.7 
Lecture: Thu, 10:00 am - 10:50pm
Access Grid Room, Motorola Bldg
2Purpose of this Class
• Introduce students to aspects of computer graphics: 
hardware, software, applications 
• Understand the basic concepts underlying computer 
graphics 
• Gain experience with at least one graphical application 
programming interface (OpenGL) 
• Carry out a large programming project of your choice 
• Use (and enjoy) the knowledge gained in previous CS/CE 
classes
3Class Overview 
• Broad and basic overview to computer graphics
– Software 
– Hardware 
– Applications 
• Approach 
– Start writing OpenGL/GLUT code that will produce 
graphical output as quickly as possible 
– Review and discuss the underlying graphics library and 
hardware 
4Prerequisites
• Good programming skills in C (or C++) 
• Basic Data Structures (linked lists, arrays) 
• Elementary understanding of geometry 
• Basic Linear Algebra 
– This class is time consuming
5Assessment
• 50% Homework, Labs, and Web Page. 
• 50% Project (Your choice) 
– 25% Project Content 
– 25% Term Paper 
– 10% Presentation/Demonstration and (attendance) 
6Text & References
• Ed Angel, Interactive Computer Graphics: A 
Top-Down Approach with OpenGL, 3rd Edition 
(International Edition), Addison-Wesley, 2003.
• OpenGL Programming Guide, Addison-Wesley, 
2003. 
• OpenGL Reference Manual, Addison-Wesley, 
2003. 
7Web Page
• For this course you are required to maintain a web 
page that will be used to display and access: 
– your programming outputs 
– a review of and link to an OpenGL tutorial you found 
useful
– Your grade will be based on content, web page layout 
and design, creativity and uniqueness of information. 
– You may (but are not required to) use this web page to 
display results for your final project. 
• Any information that has been found on the web 
should be referenced appropriately
8Project
• You choose the topic
– Needs to Graphics based
• Project Proposal due midterm
– Will meet one-on-one to review proposal
• Project presentations will be done in the first week 
of exams
– June 13-17
• Term paper
– Siggraph conference style paper (technical)
9What is Computer 
Graphics? 
• How was this image 
produced? 
– What hardware & 
software was used? 
– What math was 
applied? 
10
Solution
• Application: WETA Artist’s rendition of an Ent for 
Lord of the Rings 
• Software: Maya for Modeling and rendering 
(which is built on top of OpenGL) 
• Hardware: PC with a Graphics card for modeling 
and rendering 
11
Basic Graphics System
• A typical graphics system will contain: 
– Input devices 
– Processor 
– Memory 
– Frame Buffer 
– Output devices 
12
Input Devices
• Most input devices rely on a keyboard and a 
mouse. 
• As  the digital revolution strengthens, we are 
seeing more and more digital input devices 
available. 
– 3D digital and laser scanners (modeling), digital 
cameras (textures), wireless joysticks and mice, motion 
capture devices
• Most input devices relay positional information to 
the system (x, y, z, yaw, pitch, roll) 
13
Processors
• The processor is the heart of any normal computer. 
– Pentium, a 64-bit AMD Opteron, or any of the many other brands 
and types of processors
• Most microprocessors are CPU or central processing 
units. 
– Complete computation engines that is fabricated on a single chip. 
– General purpose and execute applications written in general 
purpose languages, such as C or Java
• Until a few years ago, programmers had to rely on the 
CPU to process all the transformation and rasterization 
algorithms 
14
Processing
• Graphics Processing Unit (GPU) 
– Computationally intensive transform and lighting calculations are 
now offloaded from the CPU onto the GPU. 
• The technical definition of a GPU is 
– "a single chip processor with integrated transform, lighting, triangle 
setup/clipping, and rendering engines that is capable of 
processing a minimum of 10 million polygons per second." 
• The advent of the GPU, allows for faster graphics 
processing speeds
• With the increasing programmability of GPUs, these chips 
are capable of performing more than the specific graphics 
computations for which they were designed
– They are now capable coprocessors, and their high speed makes 
them useful for a variety of applications
15
Transistor Count of CPU & GPU 
Processors
Year Product Name Transistors
1995 Pentium® Pro Processor 5.5 Million Transistors
1997 Pentium® II Processor 7.5 Million Transistors
1998 Pentium® II Xeon Processor 7.5 Million Transistors
1999 Celeron Processor 7.5 Million Transistors
1999 Pentium® III Processor 9.5 Million Transistors
1999 Pentium® III Xeon Processor 9.5 Million Transistors
1999 Pentium® III E 28.1 Million Transistors 
2000 Pentium® 4 42 Million Transistors
2001 GeForce 3 57 Million Transistors
2002 GeForce4 Ti 63 Million Transistors
2003 GeForceFX 125 Million Transistors
16
Frame Buffer
• In raster-based graphics systems, pictures are produced 
as an array of picture elements or pixels
• Collectively, pixels are stored in a part of the memory call 
the frame buffer 
• The number of bits used to describe a pixel within a frame 
buffer is known as the color depth or depth. 
– 24-bit bit depth (true color) , 8 bits are dedicated to each of the
three additive primary colors: red, green and blue
– 16-bit display is only capable of producing 65,536 colors
– 32 bits (a special graphics mode used by digital video, animation, 
and video games to achieve certain effects
• Essentially, 24 bits are used for color and the other 8 bits are used 
as a separate layer for representing the effect
17
Frame Buffer Depth
Bit-
Depth Number of Colors
1 2 (monochrome) 
2 4 (CGA) 
4 16 (EGA) 
8 256 (VGA) 
16 65,536 (High Color, XGA) 
24 16,777,216 (True Color, SVGA) 
32 
16,777,216 
(True Color + Alpha 
Channel)
• Depth refers to the 
number of bits used to 
describe the color of a 
single pixel
• The bit depth 
determines the number 
of colors that can be 
displayed at one time 
18
Output Devices
• A typical graphics adapter takes the digital data 
sent by application programs, stores it in video 
random access memory (VRAM) or some 
equivalent, and uses a digital-to-analog converter 
(DAC) to convert it to analog data for the output 
device
• Output devices
– Display, DVD, printer, fax, mobile phone
– Most common is CRT Display
19
Cathode Ray Tube (CRT) Display
• The terms anode and cathode are used in electronics as 
synonyms for positive and negative terminals. 
• A CRT is a specialized vacuum tube in which light is 
produced when an electron beam strikes a phosphorescent 
surface. 
• In a black-and-white screen, there is one phosphor that 
glows white when struck. 
• In a color screen, there are three phosphors arranged as 
dots or stripes that emit red, green and blue light. 
– There are also three electron beams to illuminate the three different 
colors together. 
20
Cathode Ray Tube (CRT) Display
21
Refresh Rate
• Typically, the phosphors remain excited for a short period 
of time. 
– As result the CRT will emit a light very briefly. 
• For us to see a steady image on a CRT display, the same 
paths must be refreshed by the beam at least 50 times per 
second or 50 Hertz (Hz). 
• Standard CRT displays use an interlacing technique when 
refreshing the screen. 
– In this technique, the display is refreshed 60 times per second but 
only half of the lines are refreshed per frame. 
– This is because the odd and even rows are refreshed alternately.
– In two passes, the entire display is refreshed 30 times every 
second. 
22
Plasma Displays
• A new alternative to CRT displays is the plasma flat panel display. 
• These displays have wide screens, comparable to the largest CRT 
sets, and are much thinner than the thinnest CRT display. 
• The basic idea of a plasma display is to illuminate tiny colored
fluorescent lights to form an image. 
• Each pixel is made up of three RGB fluorescent lights. The central 
element in a fluorescent light is a plasma, a gas made up of free-
flowing ions (electrically charged atoms) and electrons (negatively 
charged particles). 
– Ions are manipulated to generate light photons,which in turn are 
harnessed to generate the image. 
– For a further information on plasma displays ,see How Plasma Displays 
Work, http://electronics.howstuffworks.com/plasma-display.htm
23
History of Computer Graphics
Pre-1950
1200 Chinese Abacus
1450 Gutenberg Press
1826 Photography
1830 Babbage Analytical engine developed
1877 Edison’s Phonograph
1885 Cathode Ray Tube
1887 Edison’s Motion Picture
1890 Hollerith introduces the punch card driven tabulation
1905 Fleming – electron tube
1926 First Television developed (J. L. Baird)
1926 Hollerith introduces the 80-column “punch card”
1938 Color TV proposed (Valensi)
1946 ENIAC computer built at UPenn
24
History of Computer Graphics
1950 -1960
• Basic graphics devices were
– Light pen plotters
• Ben Sutherland, SAGE 
system at Lincoln Labs)
– Simple D/A converters to 
go from computer (digital) 
to calligraphic (analog)
• Cost or refresh rate too 
expensive
– Computers were still 
unreliable, slow, and pricey
25
Whirlwind Computer in 1st Public 
Demonstration
26
History of Computer Graphics
1960 -1970
• Wireframe graphics introduced
– Draw in lines only
• Project Sketchpad
– Ivan Sutherland’s PhD thesis at MIT
• Recognized the potential for man-machine interaction
• Loop process
– Display, move pen, redisplay
• Display processors
– Use a special purpose computer called a display processor (DPU) to 
display the graphics
– Offloaded display list off the host computer and onto the DPU
• DAC-1, first commercial CAD system, developed in 1959 by IBM for 
General Motors is shown at JCC
• Evans & Sutherland  Calma, Computek, Houston Instrument, Imlac
founded
27
Ivan Sutherland’s Project Sketchpad
28
IBM’s DAC-1
29
History of Computer Graphics
1970-1980
• Raster graphics and the beginning of graphics standards
– Imlac PDS-1 programmable graphics computer marketed
– Gouraud shading (Ref: Gouraud, Henri. Continuous Shading of Curved Surfaces. IEEE 
Transactions on Computers C-20(6), June 1971, p. 623-29. )
– DEC VT52 incorporated the first addressable cursor in a graphics display terminal
– z-buffer developed by Ed Catmull (University of Utah) (Ref: E. Catmull. A Subdivision 
Algorithm for Computer Display of Curved Surfaces, Ph.D. Thesis, Report UTEC-CSc-
74-133, Computer Science Department, University of Utah, Salt Lake City, UT, 1974)
– Phong shading - Bui-Toung Phong (University of Utah) (Ref: Bui-Tuong, Phong. 
Illumination for Computer Generated Pictures. Communications of the ACM 18(6) June 
1975, p. 311-317.)
– Catmull curved surface rendering algorithm (Ref: Catmull, Edwin. Computer Display of 
Curved Surfaces. Proceedings of the IEEE Conference on Computer Graphics, Pattern 
Recognition and Data Structures (IEEE Cat. No. 75CH0981-1C) 1975, p. 11-17. )
– Martin Newell (Utah) develops CGI teapot (physical teapot now in the Computer 
Museum in Boston)
– Jim Blinn develops reflectance and environment mapping (University of Utah)
– George Lucas hires Ed Catmull, Ralph Guggenheim and Alvy Ray Smith to form 
Lucasfilm
30
History of Computer Graphics
1970-1980
• Technological advances allow 
graphics to go from wireframes
to filled polygons
– Graphics start to become 
more real, but still not there
• GKS (Graphical Kernal System) 
graphics standard introduced
• Larry Cuba produces Death 
Star simulation for Star Wars 
using Grass at UICC developed 
by Tom DeFanti at Ohio State
31
Newell’s Utah Teapot
32
History of Computer Graphics
1980-1990
• Realism Comes to graphics
– Smooth shading, bump mapping, environment mapping
• Special purpose graphics hardware emerges
– SGI VLSI graphics pipeline
• Industry standards
– PHIGS, Renderman
• X Window system
• Human/Computer Interface
33
Cook shading model (Lucasfilm)
34
Distributed ray tracing introduced by 
Lucasfilm
35
Point Reyes - Lucasfilm
36
History of Computer Graphics
1990-2000
• OpenGL API 
• Complete computer generated feature-length 
movies (Toy Story)
• New Hardware advances
– Texture mapping, Blending, Accumulation, stencil 
buffers
37
History of Computer Graphics
2000-current
• Photorealism
• Commodity graphics cards
• Graphical Processing Units 
– Programmable
• Graphics commonplace in the movie market
– Maya, Lightwave