0% found this document useful (0 votes)
3 views50 pages

Lecture Notes in Computer Graphics

The document provides an overview of computer graphics, detailing its definition, subfields, applications, and historical development. It highlights the significance of computer graphics in various industries, including entertainment, education, and scientific visualization, while also discussing key pioneers and technological advancements in the field. The content emphasizes the evolution from early vector graphics to modern raster graphics and the impact of computer-generated imagery on daily life.

Uploaded by

Nior
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views50 pages

Lecture Notes in Computer Graphics

The document provides an overview of computer graphics, detailing its definition, subfields, applications, and historical development. It highlights the significance of computer graphics in various industries, including entertainment, education, and scientific visualization, while also discussing key pioneers and technological advancements in the field. The content emphasizes the evolution from early vector graphics to modern raster graphics and the impact of computer-generated imagery on daily life.

Uploaded by

Nior
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Lecture Notes in

CSC 423: Computer


Graphics

Lagos State University


Jibowu Campus

Lecturer: John B. Oladosu, MSc., REngr., MCPN


2

Chapter One
Introduction to Computer graphics
Computer graphics is a sub-field of computer science which studies methods for digitally
synthesizing and manipulating visual content. Although the term often refers to the study of three-
dimensional computer graphics, it also encompasses two-dimensional graphics and image processing.

Computer graphics are graphics created using computers and, more generally, the representation and
manipulation of image data by a computer.

The development of computer graphics has made computers easier to interact with, and better for
understanding and interpreting many types of data. Developments in computer graphics have had a
profound impact on many types of media and have revolutionized animation, movies and the video
game industry.

Overview
The term computer graphics has been used in a broad sense to describe "almost everything on
computers that is not text or sound". Typically, the term computer graphics refers to several different
things:

 the representation and manipulation of image data by a computer


 the various technologies used to create and manipulate images
 the images so produced, and
 the sub-field of computer science which studies methods for digitally synthesizing and
manipulating visual content

Computer graphics studies the manipulation of visual and geometric information using computational
techniques. It focuses on the mathematical and computational foundations of image generation and
processing rather than purely aesthetic issues. Computer graphics is often differentiated from the field
of visualization, although the two fields have many similarities.

Connected studies include:

 Scientific visualization
 Information visualization
 Computer vision
 Image processing
 Computational Geometry
 Computational Topology
 Applied mathematics

Applications
Applications of computer graphics include:
3

 CG art
 Computational biology
 Computational physics
 Computer Aided Design (CAD), Computer Aided Engineering (CAE), and Computer Aided
Manufacturing (CAM)Computer simulation
 Digital art
 Education/ Training
 Entertainment
 Graphic design
 Infographics
 Information visualization
 Medical applications
 Rational drug design
 Scientific visualization
 Simulation
 Special effects
 Video Games
 Virtual reality
 Web design

Subfields in computer graphics


A broad classification of major subfields in computer graphics might be:

1. Geometry: studies ways to represent and process surfaces


2. Animation: studies with ways to represent and manipulate motion
3. Rendering: studies algorithms to reproduce light transport
4. Imaging: studies image acquisition or image editing

Geometry

The subfield of geometry studies the representation of three-dimensional objects in a discrete digital
setting. Because the appearance of an object depends largely on its exterior, boundary representations
are most commonly used. Two dimensional surfaces are a good representation for most objects,
though they may be non-manifold. Since surfaces are not finite, discrete digital approximations are
used. Polygonal meshes (and to a lesser extent subdivision surfaces) are by far the most common
representation, although point-based representations have become more popular recently (see for
instance the Symposium on Point-Based Graphics). These representations are Lagrangian, meaning
the spatial locations of the samples are independent. Recently, Eulerian surface descriptions (i.e.,
where spatial samples are fixed) such as level sets have been developed into a useful representation
for deforming surfaces which undergo many topological changes (with fluids being the most notable
example).

Geometry Subfields

 Implicit surface modeling - an older subfield which examines the use of algebraic surfaces,
constructive solid geometry, etc., for surface representation.
4

 Digital geometry processing - surface reconstruction, simplification, fairing, mesh repair,


parameterization, remeshing, mesh generation, surface compression, and surface editing all
fall under this heading.
 Discrete differential geometry - a nascent field which defines geometric quantities for the
discrete surfaces used in computer graphics.
 Point-based graphics - a recent field which focuses on points as the fundamental
representation of surfaces.
 Subdivision surfaces
 Out-of-core mesh processing - another recent field which focuses on mesh datasets that do not
fit in main memory.

Animation

The subfield of animation studies descriptions for surfaces (and other phenomena) that move or
deform over time. Historically, most work in this field has focused on parametric and data-driven
models, but recently physical simulation has become more popular as computers have become more
powerful computationally.

Subfields

 Performance capture
 Character animation
 Physical simulation (e.g. cloth modeling, animation of fluid dynamics, etc.)

Rendering

Rendering generates images from a model. Rendering may simulate light transport to create realistic
images or it may create images that have a particular artistic style in non-photorealistic rendering. The
two basic operations in realistic rendering are transport (how much light passes from one place to
another) and scattering (how surfaces interact with light).

Transport

Transport describes how illumination in a scene gets from one place to another. Visibility is a major
component of light transport.

Scattering

Models of scattering and shading are used to describe the appearance of a surface. In graphics these
problems are often studied within the context of rendering since they can substantially affect the
design of rendering algorithms. Shading can be broken down into two orthogonal issues, which are
often studied independently:

1. scattering - how light interacts with the surface at a given point


2. shading - how material properties vary across the surface
5

Indirect diffuse scattering simulated using path tracing and irradiance caching

The former problem refers to scattering, i.e., the relationship between incoming and outgoing
illumination at a given point. Descriptions of scattering are usually given in terms of a bidirectional
scattering distribution function or BSDF. The latter issue addresses how different types of scattering
are distributed across the surface (i.e., which scattering function applies where). Descriptions of this
kind are typically expressed with a program called a shader. (Note that there is some confusion since
the word "shader" is sometimes used for programs that describe local geometric variation.)

Other subfields

 physically-based rendering - concerned with generating images according to the laws of


geometric optics
 real time rendering - focuses on rendering for interactive applications, typically using
specialized hardware like GPUs
 non-photorealistic rendering
 relighting - recent area concerned with quickly re-rendering scenes

Computer graphics is the life line of today's computer world. Today, computers and computer-
generated images touch many aspects of daily life. Computer imagery is found on television, in
newspapers, for example in weather reports, or for example in all kinds of medical investigation and
surgical procedures. A well-constructed graph can present complex statistics in a form that is easier to
understand and interpret. In the media "such graphs are used to illustrate papers, reports, theses", and
other presentation material.

Many powerful tools have been developed to visualize data. Computer generated imagery can be
categorized into several different types: 2D, 3D, 5D, and animated graphics. As technology has
improved, 3D computer graphics have become more common, but 2D computer graphics are still
widely used. Computer graphics has emerged as a sub-field of computer science which studies
methods for digitally synthesizing and manipulating visual content. Over the past decade, other
specialized fields have been developed like information visualization, and scientific visualization
more concerned with "the visualization of three dimensional phenomena (architectural,
meteorological, medical, biological, etc.), where the emphasis is on realistic renderings of volumes,
surfaces, illumination sources, and so forth, perhaps with a dynamic (time) component".
6

Relation of Computer Graphics to Other Fields

History of Computer Graphics


The advance in computer graphics was to come from one MIT student, Ivan Sutherland. In 1961
Sutherland created another computer drawing program called Sketchpad. Using a light pen,
Sketchpad allowed one to draw simple shapes on the computer screen, save them and even recall
them later. The light pen itself had a small photoelectric cell in its tip. This cell emitted an electronic
pulse whenever it was placed in front of a computer screen and the screen's electron gun fired directly
at it. By simply timing the electronic pulse with the current location of the electron gun, it was easy to
pinpoint exactly where the pen was on the screen at any given moment. Once that was determined,
the computer could then draw a cursor at that location.

Sutherland seemed to find the perfect solution for many of the graphics problems he faced. Even
today, many standards of computer graphics interfaces got their start with this early Sketchpad
program. One example of this is in drawing constraints. If one wants to draw a square for example,
s/he doesn't have to worry about drawing four lines perfectly to form the edges of the box. One can
simply specify that s/he wants to draw a box, and then specify the location and size of the box. The
software will then construct a perfect box, with the right dimensions and at the right location. Another
example is that Sutherland's software modeled objects - not just a picture of objects. In other words,
with a model of a car, one could change the size of the tires without affecting the rest of the car. It
could stretch the body of the car without deforming the tires.

These early computer graphics were Vector graphics, composed of thin lines whereas modern
day graphics are Raster based using pixels. The difference between vector graphics and raster
graphics can be illustrated with a shipwrecked sailor. He creates an SOS sign in the sand by arranging
rocks in the shape of the letters "SOS." He also has some brightly colored rope, with which he makes
a second "SOS" sign by arranging the rope in the shapes of the letters. The rock SOS sign is similar to
raster graphics. Every pixel has to be individually accounted for. The rope SOS sign is equivalent to
vector graphics. The computer simply sets the starting point and ending point for the line and perhaps
bend it a little between the two end points. The disadvantages to vector files are that they cannot
represent continuous tone images and they are limited in the number of colors available. Raster
7

formats on the other hand work well for continuous tone images and can reproduce as many colors as
needed.

Also in 1961 another student at MIT, Steve Russell, created the first video game, Spacewar. Written
for the DEC PDP-1, Spacewar was an instant success and copies started flowing to other PDP-1
owners and eventually even DEC got a copy. The engineers at DEC used it as a diagnostic program
on every new PDP-1 before shipping it. The sales force picked up on this quickly enough and when
installing new units, would run the world's first video game for their new customers.

E. E. Zajac, a scientist at Bell Telephone Laboratory (BTL), created a film called "Simulation of a
two-giro gravity altitude control system" in 1963. In this computer generated film, Zajac showed how
the altitude of a satellite could be altered as it orbits the Earth. He created the animation on an IBM
7090 mainframe computer. Also at BTL, Ken Knowlton, Frank Sindon and Michael Noll started
working in the computer graphics field. Sindon created a film called Force, Mass and Motion
illustrating Newton's laws of motion in operation. Around the same time, other scientists were
creating computer graphics to illustrate their research. At Lawrence Radiation Laboratory, Nelson
Max created the films, "Flow of a Viscous Fluid" and "Propagation of Shock Waves in a Solid Form."
Boeing Aircraft created a film called "Vibration of an Aircraft."

It wasn't long before major corporations started taking an interest in computer graphics. TRW,
Lockheed-Georgia, General Electric and Sperry Rand are among the many companies that were
getting started in computer graphics by the mid 1960's. IBM was quick to respond to this interest by
releasing the IBM 2250 graphics terminal, the first commercially available graphics computer.

Ralph Baer, a supervising engineer at Sanders Associates, came up with a home video game in 1966
that was later licensed to Magnavox and called the Odyssey. While very simplistic, and requiring
fairly inexpensive electronic parts, it allowed the player to move points of light around on a screen. It
was the first consumer computer graphics product.

Also in 1966, Sutherland at MIT invented the first computer controlled head-mounted display
(HMD). Called the Sword of Damocles because of the hardware required for support, it displayed two
separate wireframe images, one for each eye. This allowed the viewer to see the computer scene in
stereoscopic 3D. After receiving his Ph.D. from MIT, Sutherland became Director of Information
Processing at ARPA (Advanced Research Projects Agency), and later became a professor at Harvard.

Dave Evans was director of engineering at Bendix Corporation's computer division from 1953 to
1962, after which he worked for the next five years as a visiting professor at Berkeley. There he
continued his interest in computers and how they interfaced with people. In 1968 the University of
Utah recruited Evans to form a computer science program, and computer graphics quickly became his
primary interest. This new department would become the world's primary research center for
computer graphics.

In 1967 Sutherland was recruited by Evans to join the computer science program at the University of
Utah. There he perfected his HMD. Twenty years later, NASA would re-discover his techniques in
their virtual reality research. At Utah, Sutherland and Evans were highly sought after consultants by
large companies but they were frustrated at the lack of graphics hardware available at the time so they
started formulating a plan to start their own company.
8

A student by the name of Edwin Catmull started at the University of Utah in 1970 and signed up for
Sutherland's computer graphics class. Catmull had just come from The Boeing Company and had
been working on his degree in physics. Growing up on Disney, Catmull loved animation yet quickly
discovered that he didn't have the talent for drawing. Now Catmull (along with many others) saw
computers as the natural progression of animation and they wanted to be part of the revolution. The
first animation that Catmull saw was his own. He created an animation of his hand opening and
closing. It became one of his goals to produce a feature length motion picture using computer
graphics. In the same class, Fred Parke created an animation of his wife's face. Because of Evan's and
Sutherland's presence, UU was gaining quite a reputation as the place to be for computer graphics
research so Catmull went there to learn 3D animation.

As the UU computer graphics laboratory was attracting people from all over, John Warnock was one
of those early pioneers; he would later found Adobe Systems and create a revolution in the publishing
world with his PostScript page description language. Tom Stockham led the image processing group
at UU which worked closely with the computer graphics lab. Jim Clark was also there; he would later
found Silicon Graphics, Inc.

The first major advance in 3D computer graphics was created at UU by these early pioneers, the
hidden-surface algorithm. In order to draw a representation of a 3D object on the screen, the computer
must determine which surfaces are "behind" the object from the viewer's perspective, and thus should
be "hidden" when the computer creates (or renders) the image.

One of the first displays of computer animation was Futureworld (1976), which included an
animation of a human face and hand — produced by Ed Catmull and Fred Parke at the University of
Utah.

There are several international conferences and journals where the most significant results in
computer graphics are published. Among them are the SIGGRAPH and Eurographics conferences
and the Association for Computing Machinery (ACM) Transactions on Graphics journal. The joint
Eurographics and ACM SIGGRAPH symposium series features the major venues for the more
specialized sub-fields: Symposium on Geometry Processing, Symposium on Rendering, and
Symposium on Computer Animation. As in the rest of computer science, conference publications in
computer graphics are generally more significant than journal publications (and subsequently have
lower acceptance rates).

Pioneers in graphic design


Charles Csuri
Charles Csuri is a pioneer in computer animation and digital fine art and created the first
computer art in 1964. Csuri was recognized by Smithsonian as the father of digital art and
computer animation, and as a pioneer of computer animation by the Museum of Modern Art
(MoMA) and (ACM-SIGGRAPH).
Donald P. Greenberg
Donald P. Greenberg is a leading innovator in computer graphics. Greenberg has authored
hundreds of articles and served as a teacher and mentor to many prominent computer graphic
artists, animators, and researchers such as Robert L. Cook, Marc Levoy, and Wayne Lytle.
Many of his former students have won Academy Awards for technical achievements and
several have won the SIGGRAPH Achievement Award. Greenberg was the founding director
of the NSF Center for Computer Graphics and Scientific Visualization.
9

A. Michael Noll
Noll was one of the first researchers to use a digital computer to create artistic patterns and to
formalize the use of random processes in the creation of visual arts. He began creating digital
computer art in 1962, making him one of the earliest digital computer artists. In 1965, Noll
along with Frieder Nake and Georg Nees were the first to publicly exhibit their computer art.
During April 1965, the Howard Wise Gallery exhibited Noll's computer art along with
random-dot patterns by Bela Julesz.

Other pioneers

 Jim Blinn
 Arambilet
 Benoît B. Mandelbrot
 Henri Gouraud
 Bui Tuong Phong
 Pierre Bézier
 Paul de Casteljau
 Daniel J. Sandin
 Alvy Ray Smith
 Ton Roosendaal
 Ivan Sutherland
 Steve Russell

The study of computer graphics


The study of computer graphics is a sub-field of computer science which studies methods for digitally
synthesizing and manipulating visual content. Although the term often refers to three-dimensional
computer graphics, it also encompasses two-dimensional graphics and image processing.

As an academic discipline, computer graphics studies the manipulation of visual and geometric
information using computational techniques. It focuses on the mathematical and computational
foundations of image generation and processing rather than purely aesthetic issues. Computer
graphics is often differentiated from the field of visualization, although the two fields have many
similarities.

Image types
2D computer graphics

2D computer graphics are the computer-based generation of digital images—mostly from two-
dimensional models, such as 2D geometric models, text, and digital images, and by techniques
specific to them. The word may stand for the branch of computer science that comprises such
techniques, or for the models themselves.
10

Raster graphic sprites (left) and masks (right)

A 2D projection of a 3D projection of a 4D Pentachoron

2D computer graphics are mainly used in applications that were originally developed upon traditional
printing and drawing technologies, such as typography, cartography, technical drawing, advertising,
etc.. In those applications, the two-dimensional image is not just a representation of a real-world
object, but an independent artifact with added semantic value; two-dimensional models are therefore
preferred, because they give more direct control of the image than 3D computer graphics, whose
approach is more akin to photography than to typography.

Pixel art

Pixel art is a form of digital art, created through the use of raster graphics software, where images are
edited on the pixel level. Graphics in most old (or relatively limited) computer and video games,
graphing calculator games, and many mobile phone games are mostly pixel art.

Vector graphics

Vector graphics formats are complementary to raster graphics, which is the representation of images
as an array of pixels, as it is typically used for the representation of photographic images. There are
instances when working with vector tools and formats is best practice, and instances when working
with raster tools and formats is best practice. There are times when both formats come together. An
understanding of the advantages and limitations of each technology and the relationship between
them is most likely to result in efficient and effective use of tools.
11

Example showing effect of vector graphics versus raster (bitmap) graphics

3D computer graphics

3D computer graphics in contrast to 2D computer graphics are graphics that use a three-dimensional
representation of geometric data that is stored in the computer for the purposes of performing
calculations and rendering 2D images. Such images may be for later display or for real-time viewing.

Despite these differences, 3D computer graphics rely on many of the same algorithms as 2D computer
vector graphics in the wire frame model and 2D computer raster graphics in the final rendered
display. In computer graphics software, the distinction between 2D and 3D is occasionally blurred;
2D applications may use 3D techniques to achieve effects such as lighting, and primarily 3D may use
2D rendering techniques.

3D computer graphics are often referred to as 3D models. Apart from the rendered graphic, the model
is contained within the graphical data file. However, there are differences. A 3D model is the
mathematical representation of any three-dimensional object. A model is not technically a graphic
until it is visually displayed. Due to 3D printing, 3D models are not confined to virtual space. A
model can be displayed visually as a two-dimensional image through a process called 3D rendering,
or used in non-graphical computer simulations and calculations.

Computer animation

Computer animation is the art of creating moving images via the use of computers. It is a subfield of
computer graphics and animation. Increasingly it is created by means of 3D computer graphics,
though 2D computer graphics are still widely used for stylistic, low bandwidth, and faster real-time
12

rendering needs. Sometimes the target of the animation is the computer itself, but sometimes the
target is another medium, such as film. It is also referred to as CGI (Computer-generated imagery or
computer-generated imaging), especially when used in films.

An example of Computer animation produced using Motion capture

Virtual entities may contain and be controlled by assorted attributes, such as transform values
(location, orientation, and scale) stored in an object's transformation matrix. Animation is the change
of an attribute over time. Multiple methods of achieving animation exist; the rudimentary form is
based on the creation and editing of keyframes, each storing a value at a given time, per attribute to be
animated. The 2D/3D graphics software will interpolate between keyframes, creating an editable
curve of a value mapped over time, resulting in animation. Other methods of animation include
procedural and expression-based techniques: the former consolidates related elements of animated
entities into sets of attributes, useful for creating particle effects and crowd simulations; the latter
allows an evaluated result returned from a user-defined logical expression, coupled with mathematics,
to automate animation in a predictable way (convenient for controlling bone behavior beyond what a
hierarchy offers in skeletal system set up).

To create the illusion of movement, an image is displayed on the computer screen then quickly
replaced by a new image that is similar to the previous image, but shifted slightly. This technique is
identical to the illusion of movement in television and motion pictures.

Concepts and principles


A digital image is a representation of a two-dimensional image in binary format as a sequence of ones
and zeros. Digital images include both vector images and raster images, but raster images are more
commonly used.

Pixel

In the enlarged portion of the image individual pixels are rendered as squares and can be easily seen.
13

In digital imaging, a pixel (or picture element) is a single point in a raster image. Pixels are normally
arranged in a regular 2-dimensional grid, and are often represented using dots or squares. Each pixel
is a sample of an original image, where more samples typically provide a more accurate
representation of the original. The intensity of each pixel is variable; in color systems, each pixel has
typically three components such as red, green, and blue.

Graphics

Graphics are visual presentations on some surface, such as a wall, canvas, computer screen, paper, or
stone to brand, inform, illustrate, or entertain. Examples are photographs, drawings, line art, graphs,
diagrams, typography, numbers, symbols, geometric designs, maps, engineering drawings, or other
images. Graphics often combine text, illustration, and color. Graphic design may consist of the
deliberate selection, creation, or arrangement of typography alone, as in a brochure, flier, poster, web
site, or book without any other element. Clarity or effective communication may be the objective,
association with other cultural elements may be sought, or merely, the creation of a distinctive style.

Arambilet: Dots on the I's, D-ART 2009 Online Digital Art Gallery, exhibited at IV09 and CG09
computer Graphics conferences, at Pompeu Fabra University, Barcelona; Tianjin University, China;
Permanent Exhibition at the London South Bank University

Rendering

A 2D/3D scene file contains objects in a strictly defined language or data structure. It would contain
geometry, viewpoint, texture, lighting, and shading information as a description of the virtual scene.
The data contained in the scene file is then passed to a rendering program to be processed and output
to a digital image or raster graphics image file. The rendering program is usually built into the
computer graphics software, though others are available as plug-ins or entirely separate programs;
examples include mental images' mental ray and Disney Pixar's RenderMan. The term "rendering"
may be by analogy with an "artist's rendering" of a scene. Though the technical details of rendering
methods vary, the general challenges to overcome in producing a 2D image from a 3D representation
stored in a scene file are outlined collectively as the graphics pipeline along a rendering device, such
as a GPU. A GPU is a purpose-built device able to assist a CPU in performing complex rendering
calculations. If a scene is to look relatively realistic and predictable under virtual lighting, the
rendering software should solve the rendering equation. The rendering equation doesn't account for all
lighting phenomena, but is a general lighting model for computer-generated imagery. 'Rendering' is
also used to describe the process of calculating effects in a video editing file to produce final video
output.

3D projection
3D projection is a method of mapping three dimensional points to a two dimensional plane. As
most current methods for displaying graphical data are based on planar two dimensional
14

media, the use of this type of projection is widespread, especially in computer graphics,
engineering and drafting.
Ray tracing
Ray tracing is a technique for generating an image by tracing the path of light through pixels
in an image plane. The technique is capable of producing a very high degree of photorealism;
usually higher than that of typical scanline rendering methods, but at a greater computational
cost.
Shading
Shading refers to depicting depth in 3D models or illustrations by varying levels of darkness.
It is a process used in drawing for depicting levels of darkness on paper by applying media
more densely or with a darker shade for darker areas, and less densely or with a lighter shade
for lighter areas. There are various techniques of shading including cross hatching where
perpendicular lines of varying closeness are drawn in a grid pattern to shade an area. The
closer the lines are together, the darker the area appears. Likewise, the farther apart the lines
are, the lighter the area appears. The term has been recently generalized to mean that shaders
are applied.

Example of shading.

Texture mapping
Texture mapping is a method for adding detail, surface texture, or colour to a computer-
generated graphic or 3D model. Its application to 3D graphics was pioneered by Dr Edwin
Catmull in 1974. A texture map is applied (mapped) to the surface of a shape, or polygon.
This process is akin to applying patterned paper to a plain white box. Multitexturing is the use
of more than one texture at a time on a polygon. Procedural textures (created from adjusting
parameters of an underlying algorithm that produces an output texture), and bitmap textures
(created in an image editing application) are, generally speaking, common methods of
implementing texture definition from a 3D animation program, while intended placement of
textures onto a model's surface often requires a technique known as UV mapping.
Anti-aliasing
Rendering resolution-independent entities (such as 3D models) for viewing on a raster (pixel-
based) device such as a LCD display or CRT television inevitably causes aliasing artifacts
mostly along geometric edges and the boundaries of texture details; these artifacts are
informally called "jaggies". Anti-aliasing methods rectify such problems, resulting in imagery
more pleasing to the viewer, but can be somewhat computationally expensive. Various anti-
aliasing algorithms (such as supersampling) are able to be employed, then customized for the
most efficient rendering performance versus quality of the resultant imagery; a graphics artist
should consider this trade-off if anti-aliasing methods are to be used. A pre-anti-aliased bitmap
texture being displayed on a screen (or screen location) at a resolution different than the
resolution of the texture itself (such as a textured model in the distance from the virtual
camera) will exhibit aliasing artifacts, while any procedurally-defined texture will always
15

show aliasing artifacts as they are resolution-independant; techniques such as mipmapping and
texture filtering help to solve texture-related aliasing problems.

Volume rendering

Volume rendered CT scan of a forearm with different colour schemes for muscle, fat, bone, and
blood.

Volume rendering is a technique used to display a 2D projection of a 3D discretely sampled data set.
A typical 3D data set is a group of 2D slice images acquired by a CT or MRI scanner.

Usually these are acquired in a regular pattern (e.g., one slice every millimeter) and usually have a
regular number of image pixels in a regular pattern. This is an example of a regular volumetric grid,
with each volume element, or voxel represented by a single value that is obtained by sampling the
immediate area surrounding the voxel.

A modern render of the Utah teapot, an iconic model in 3D computer graphics created by Martin
Newell, 1975

3D modeling

3D modeling is the process of developing a mathematical, wireframe representation of any three-


dimensional object, called a "3D model", via specialized software. Models may be created
automatically or manually; the manual modeling process of preparing geometric data for 3D
computer graphics is similar to plastic arts such as sculpting. 3D models may be created using
multiple approaches: use of NURBS curves to generate accurate and smooth surface patches,
polygonal mesh modeling (manipulation of faceted geometry), or polygonal mesh subdivision
16

(advanced tessellation of polygons, resulting in smooth surfaces similar to NURBS models). A 3D


model can be displayed as a two-dimensional image through a process called 3D rendering, used in a
computer simulation of physical phenomena, or animated directly for other purposes. The model can
also be physically created using 3D Printing devices.
17

Chapter Two
Overview of Graphics Systems
Output Devices

Output devices are feedback devices that display the output from the computer. There is a wide
variety of output devices designed for various purposes.

Text CRT (Cathode Ray Tubes) - These devices can display letters, numbers, punctuation, and
other simple symbols, usually only in monochrome (black and white, black and green, black and
amber). These characters are fixed in memory called character ROM .
Color Raster CRT - Display shaded and color images with high resolution. Images are dynamically
stored in a piece of memory called a frame buffer.
Printer - This is like CRT, except that it gives a hardcopy (not a softcopy ).
Film (video) recorder - This is like a color raster CRT. The images are stored in digitized form on
magnetic media.
Plotter - This is like a slow calligraphic CRT. Flatbed plotter, drum plotter are some of the plotters
available. Plotters can be very useful in drawing the graphs, barcharts, linedrawing and maps on rolls
of paper or sheets.
Head mounted displays - These are virtual reality displays which can project information on a
partially silvered wind screen of an airplane or car so that pilots or drivers can keep their attention
focused on the surroundings while receiving computer generated information.

Input Devices
Track balls and joysticks - usually used in computer games. These are analog input devices, which
are controlled by transducers.
Transducer is a device which converts the user's movements into changes in voltage or amperage by
varying the resistance of the circuit.
Mouse – good for choosing, positioning and drawing. The mechanical mouse is similar to the track
ball which uses two variable resistors to specify the x and y information. The digital version like the
optical mouse and acoustic mouse are also available.
18

Keyboard - good for entering alpha numeric data. The computer encodes the keyboard characters
using the American Standard Code for Information Interchange (ASCII). Each key has a unique 7-bit
ASCII code associated with it, with which we can communicate with the computer.
19

Chapter Three
Graphics Primitives
A primitive is a graphics object that is essential for the creation or construction of complex images.
Fortunately, graphics is constructed from three basic elements, as opposed to the great variety of
graphics applications.
 Pixel
 Line
 Polygon

Pixels

 A pixel is a point of light.


 It is just one tiny dot on the raster displays.
 Though it has no structure, it is definitely a building block and hence it can be considered as
the graphics primitive.
 The resolution of the CRT is defined as the number of pixels per unit length that can be
plotted horizontally or vertically.

Example: Compute the size of an image that has 512 X 512 pixels at 256 pixels per inch.

Answer: 512pixel/256 pixels per inch by 512pixel/256 pixels per inch = 2 inch by 2 inch

 As the resolution of the screen increased, a better quality graphics we can get.
 Image representation with pixels can be done using direct coding or lookup table.

Direct coding

Direct coding is used to allocate certain amount of storage space for each pixel to code its colour.
Example: If we use direct coding of RGB values with 4 bits per primary color, how many possible
colors do you have for each pixel?

Answer: There are 2^4 = 16 possible colors per each channel (Red for example).
This makes 2^4 X 2^4 X 2^4 = 2^12 = 4092 possible different colors for a pixel.

Lookup table

A colour look-up table (CLUT) is a mechanism used to transform a range of input colours into
another range of colours. It can be a hardware device built into an imaging system or a software
function built into an image processing application. The hardware colour look-up table will convert
the logical colour (pseudo-colour) numbers stored in each pixel of video memory into physical
colours, normally represented as RGB triplets, that can be displayed on a computer monitor. The
palette is simply a block of fast RAM which is addressed by the logical colour and whose output is
20

split into the red, green, and blue levels which drive the actual display (e.g., a CRT or cathode ray
tube).

A CLUT is characterized by:

 The number of entries in the palette: determines the maximum number of colours which can
appear on screen simultaneously (a subset of the wider full palette, which is to be understood
as the total number of colours that a given system is able to generate or manage, e.g. the full
RGB colour palette).
 The width of each entry in the palette: determines the number of colours which the wider full
palette can represent.

A common example would be a palette of 256 colours; that is, the number of entries is 256, and thus
each entry is addressed by an 8-bit pixel value. The 8 bits is known as colour depth, bit depth or bits
per pixel (bpp). Each colour can be chosen from a full palette, typically with a total of 16.7 million
colours; that is, the width of each entry is 24 bits, 8 bits per channel, which means combinations of
256 levels for each of the red, green, and blue components: 256 × 256 × 256 = 16,777,216 colours.

Lines
 Lines, especially straight lines, constitute an important building block of computer images.
 Line is the basic building block of Line graphs, like bar and pie charts, two and three-
dimensional graphs of mathematical functions, engineering drawings and architectural plans.
 In computer graphics, straight line is so basic in creating images that we call it a graphics
primitive.
 Straight lines can be developed in two different ways.
1. A structural method determines which pixels should be set before drawing the line;
2. A conditional method tests certain conditions to find which pixel should be set next.

Polygons

 A polygon is a shape generally constructed from straight lines.


 A polygon is a closed area of image bounded by straight or curved lines and filled with one
solid color. Since images are two dimensional, a polygon is a closed planar figure.
 The polygon can be defined by an ordered sequence of vertices, the corners of the polygon.
21

Chapter Four
Transformations and Animation
Basic Transformations
 Basic Transformations
o Translation
o Rotation
o Scaling
 Composite Transformations
 Other Transformations
o Reflections
o Shear

Translation

A translation is the process of repositioning the object along a straightline path from one coordinate
to another.
Let
(x, y) be the original coordinate position.
(x′, y′) be the new position after translation
tx and ty be the translation distances in the x and y directions.

x′ = x + tx
y′ = y + t y

The translation distance pair


(tx ,ty ) is called a translation vector or shift vector.
22

Rotation
A two-D rotation is applied to an object by repositioning it along a circular path in the xy plane.
To generate a rotation:
* We specify a rotation angle θ
*The position (xr , yr ) of the rotation point (or pivot point)

Positive values for the rotation angle define CCW rotations about the pivot point and negative values
rotate objects in the CW direction.
23

Rotation about the origin


Let
24

Rotation about a pivot point


25

Scaling

Scaling is the transformation that alters the size of an object,


i.e. enlarging or reducing the size of the object.
26

Fixed Point Scaling


27

Matrix Representation
Many graphics applications involve sequences of geometric transformations.
An animation, for example, might require an object to be translated and rotated at each increment of
the motion.
In picture construction applications, we perform translations, rotations, and scalings to fit the picture
components into their proper positions.
28

For translation,
M1 is the identity matrix.
M2 is the translation vector.

For rotation or scaling,


M1 is a 2 by 2 matrix representing the rotation and scaling.
M2 Contains the translational terms associated with pivot point and fixed point scaling.

To produce a sequence of transformations with these equations, we must calculate the


transformed coordinates one step at a time.

Homogeneous Coordinates
We can combine the multiplicative and translational terms for two-D geometric transformations into a
single matrix representation by expanding the 2 by 2 matrix representations to 3 by 3 matrices.
This allows us to express all transformation equations as matrix multiplications, providing that we
also expand the matrix representations for coordinate positions.

Each Cartesian coordinate position (x, y) is represented with the homogeneous coordinate triple (xh ,
yh , h)

Thus, a general homogeneous coordinate representation can also be written as (h ⋅ x,h ⋅ y,h)
A convenient choice is simply to set h =1
Each two-dimensional position is then represented with homogeneous coordinates (x, y,1)
Expressing positions in homogeneous coordinates allows us to represent all geometric transformation
equations as matrix multiplications.
29

Transformation with Homogeneous Coordinates

Composite Transformations

Two successive translations are additive.


30

Two successive rotations are additive.

Successive scaling operations are multiplicative


31

General Pivot Point Rotation


1. Translate the object so that the pivot-point position is moved to the coordinate origin.
2. Rotate the object about the coordinate origin.
3. Translate the object so that the pivot point is returned to its original position.

The composite transformation matrix for this sequence is obtained with the concatenation
32

General Fixed Point Scaling


1. Translate object so that the fixed point coincides with the coordinate origin.
2. Scale the object with respect to the coordinate origin.
3. Use the inverse translation of step 1 to return the object to its original position.

General Scaling Directions


Suppose we want to apply scaling factors with values specified by parameters s1 and s2 in the
directions shown
1. First perform a rotation in the CCW direction to coincide the axes.
1. Apply scaling transformation
2. A rotation in the CW direction to return points to their original orientations.
33

Reflections
A reflection is a transformation that produces a mirror image of an object.
The mirror image for a two-dimensional reflection is generated relative to an axis of reflection by
rotating the object 180° about the reflection axis.
34

Reflection about the line y = 0 (x-axis)

Reflection about the line x = 0 (y-axis)

Reflection about a point on the xy-plane


35

Reflection about the y = x


1. Rotate the object about the origin CCW by 45 deg.
2. Apply reflection about the x-axis.
3. A rotation in the CW direction by 45 deg.

Shear
A transformation that distorts the shape of an object such that the transformed shape appears as if the
object were composed of internal layers that had been caused to slide over each other is called a
shear.

An x-direction shear:
x′ = x + shx .y
y′ = y
36
37

Chapter Five
Introduction to Graphics Programming,
Geometric Objects & User Interaction
OpenGL programming

Set up OpenGL programming environment

You will need Visual Studio (VS) 2005 or later

● Copy the files:

1. Download freeglut-2.6.0 (if you are using VS 2008) or freeglut-2.4.0 (if you are using VS 2005)

2. Go to folder "freeglut-2.6.0\VisualStudio2008" and open the "freeglut" solution file in Visual


Studio 2008.

3. Build the project. Under the newly created "Debug" folder, you'll find [Link] and [Link].

4. Copy [Link] to "c:\windows\system32"

5. Go to folder "freeglut-2.6.0\include" and copy freeglut.h, freeglut_ext.h, and freeglut_std.h to


"C:\Program Files\Microsoft Visual Studio 9.0\VC\include\GL". If the "GL" folder doesn't exist,
create it.

● Download GLEW from [Link]


● Follow the installation instructions at [Link]
● Include glew.h in your OpenGL code
– glew.h must be placed before freeglut.h.

Set up Visual Studio 2008:

1. In Visual Studio 2008, create a "Win32 Console Application".


2. In the "Win32 Application Wizard", under "Application Settings", check "Empty project". (The
default is "Precompiled header". You don't need it.)
3. After the project is created, right click on the project name and select "Properties".
4. In the "Property Pages" window, click Linker --> Input, and add the following files to the
"Additional Dependencies" line:
38

[Link] [Link] [Link] (Note that [Link] and [Link] come with Visual Studio
2008.)

You can find plenty of OpenGL samples at [Link]


and [Link]

Drag and drop any OpenGL programs to the "Source Files" node under the project you created in VS
2008. Whenever you see

#include <GL/glut.h>

change it to

#include <GL/freeglut.h>

Coordinate systems

• Each point and vector is defined in reference to a coordinate system


• Once we fix the origin of the coordinate system, we can represent all points unambiguously
– The same point may have different 3D coordinates in different coordinate systems
– Remember that part of the job of 3D graphics pipeline is to convert vertices from
model space to 2D window space
– Each vertex with go through several coordinate systems along the pipeline
• A 3D coordinate system is defined by its three base vectors (x, y, and z axis)
• Get familiar with OpenGL’s coordinate system

Graphics primitives

● In computer graphics, we work with 3D models (geometry objects)


● 3D objects are described by their surfaces
39

– Can be thought of as being hollow


● Complex 3D objects either are composed of or can be approximated by flat convex polygons
– Curved surfaces are approximated by flat polygons
● Polygons can be specified through a set of 3D vertices
● The basic graphics primitives are points, lines, and polygons
– A polygon can be defined by an ordered set of vertices
● Graphics hardware is optimized for processing points and flat polygons
● Complex objects are eventually divided into triangular polygons (a process called tessellation)
– Because triangular polygons are always flat
● The basic geometric primitives can be described using three fundamental types:
– Scalars, points, and vectors
● Point: a location in the 3D space
– E.g. vertex, pixel
● Scalars: real numbers
– E.g. distance between two points
● Vector: direction or directed line segment
– No fixed position in 3D space
– E.g. surface normal, light direction, camera direction

Graphics Primitives in OpenGL

● How to represent points and vector in OpenGL? Use array.


40

● Example

GLfloat normals[][3] = {{0.0, 0.0, -1.0}, {0.0, 1.0, 0.0}, {-1.0, 0.0, 0.0}};

GLfloat light0_pos[4] = {0.9, 0.9, 2.25, 0.0};

Immediate vs. Retained mode

● ―Immediate mode‖ rendering


– 3D primitives are rendered immediately when they are specified, without storing in a
data structure
– Immediate mode is the default mode in OpenGL
– Sufficient for small programs
● ―Retained‖ mode rendering
– 3D objects are stored in a data structure (e.g. display list) and rendered later
– Lots of opportunities for performance optimization
– Display list is a simple form of retained rendering
– Large scale 3D applications use scene graph

How to develop GUI for 3D applications?

● Many game companies develop their own GUI library on Windows


– Relatively few people use .NET
● For cross platform GUI
– GLUT (for very simple GUI)
– FLTK ([Link])
– Qt
– Java + JOGL
– WxWidgets ([Link] open source, cross-platform GUI API
– See OpenGL Wiki for a list of tools

GLUT window management

● GLUT provides some window management functions:


– glutCreateWindow, glutDestroyWindow
– glutPostRedisplay
– glutSwapBuffers
– glutPositionWindow, glutReshapeWindow
– glutFullScreen
– glutShowWindow, glutHideWindow, etc.
● See [Link] for details

GLUT menu management

● GLUT provides simple menu management functions


– glutCreateMenu
– glutSetMenu, glutGetMenu
– glutDestroyMenu
– glutAddMenuEntry
41

– glutAddSubMenu
– glutAttachMenu, glutDetachMenu, etc.
● See [Link] for details

GLUT Menu Example

sub_menu = glutCreateMenu(size_menu);

glutAddMenuEntry(―increase square size‖, 2);

glutAddMenuEntry(―decrease square size‖, 3);

glutCreateMenu(top_menu);

glutAddMenuEntry(―quit‖, 1);

glutAddSubMenu(―Resize‖, sub_menu);

glutAttachMenu(GLUT_RIGHT_BUTTON);

How to read from input devices?

● Keyboard/mouse: use GLUT, DirectX, X Window, etc.


● Joystick: DirectX, X Window
● Unconventional input devices: write program that directly talks to device drivers, or use
commercial tools

Input Modes

● Input devices contain a trigger which can be used to send a signal to the operating system
– Button on mouse
– Pressing or releasing a key
● When triggered, input devices return information (their measure) to the system
– Mouse returns position information
– Keyboard returns ASCII code

Request Mode

● Input provided to program only when user triggers the device


● Typical of keyboard input
– Can erase (backspace), edit, correct until enter (return) key (the trigger) is depressed
42

Event Mode

● Most systems have more than one input device, each of which can be triggered at an arbitrary
time by a user
● Each trigger generates an event whose measure is put in an event queue which can be
examined by the user program

Event Types

● Window: resize, expose, iconify


● Mouse: click one or more buttons
● Motion: move mouse
● Keyboard: press or release a key
● Idle: nonevent
– Define what should be done if no other event is in queue

Callbacks

● Programming interface for event-driven input


● Define a callback function for each type of event the graphics system recognizes
● This user-supplied function is executed when the event occurs
● GLUT example: glutMouseFunc(mymouse)

GLUT callbacks

● GLUT recognizes a subset of the events recognized by any particular window system
(Windows, X Window, Macintosh)
● Can register callback functions to handle those events
– glutDisplayFunc
– glutMouseFunc
– glutReshapeFunc
– glutKeyFunc
– glutIdleFunc
– glutMotionFunc, glutPassiveMotionFunc
● See [Link] for details
43

GLUT Event Loop

● Remember that the last line in main.c for a program using GLUT must be

glutMainLoop();

which puts the program in an infinite event loop

● In each pass through the event loop, GLUT


– looks at the events in the queue
– for each event in the queue, GLUT executes the appropriate callback function if one is
defined
– if no callback is defined for the event, the event is ignored

The display callback

● The display callback is executed whenever GLUT determines that the window should be
refreshed, for example
– When the window is first opened
– When the window is reshaped
– When a window is exposed
– When the user program decides it wants to change the display
● In main.c
– glutDisplayFunc(mydisplay) identifies the function to be executed
– Every GLUT program must have a display callback

Posting redisplays

● Many events may invoke the display callback function


– Can lead to multiple executions of the display callback on a single pass through the
event loop
● We can avoid this problem by instead using

glutPostRedisplay();

which sets a flag.

● GLUT checks to see if the flag is set at the end of the event loop
● If set then the display callback function is executed

Animation = Redraw + Swap

● When we redraw the display through the display callback, we usually start by clearing the
window with glClear()and then draw the next frame
● Instead of one color buffer, we use two
– Front Buffer: one that is displayed but not written to
– Back Buffer: one that is written to but not altered

Animation = Redraw + Swap


44

● Program then requests a double buffer in main.c


– glutInitDisplayMode(GL_RGB | GL_DOUBLE)
– At the end of the display callback buffers are swapped

Use idle callback for animation

● The idle callback is executed whenever there are no events in the event queue
– glutIdleFunc(myidle)
● Useful for automatic animations. For example:

void main(int argc, char **argv) {

glutInit(&argc, argv);

glutInitDisplayMode(GLUT_DEPTH | GLUT_DOUBLE | GLUT_RGBA);

glutInitWindowPosition(100,100); glutInitWindowSize(320,320);
45

glutCreateWindow("");

glutDisplayFunc(renderScene);

glutIdleFunc(renderScene);

glutReshapeFunc(changeSize); glEnable(GL_DEPTH_TEST);

glutMainLoop();

// A triangle is automatically rotated

void renderScene(void) {

glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

glPushMatrix();

glRotatef(angle,0.0,1.0,0.0);

glBegin(GL_TRIANGLES);

glVertex3f(-0.5,-0.5,0.0);

glVertex3f(0.5,0.0,0.0);

glVertex3f(0.0,0.5,0.0);

glEnd();

glPopMatrix();

glutSwapBuffers();

// Increase the angle for the next frame

angle++;

● See [Link] for details.

A Simple OpenGL Program (1)

#include <GL/glut.h>
46

void display(void)

/* clear all pixels */

glClear (GL_COLOR_BUFFER_BIT);

/* draw white polygon (rectangle) with corners at

* (0.25, 0.25, 0.0) and (0.75, 0.75, 0.0)

*/

glColor3f (1.0, 1.0, 1.0);

glBegin(GL_POLYGON);

glVertex3f (0.25, 0.25, 0.0);

glVertex3f (0.75, 0.25, 0.0);

glVertex3f (0.75, 0.75, 0.0);

glVertex3f (0.25, 0.75, 0.0);

glEnd();

A Simple OpenGL Program (2)

/* start processing buffered OpenGL routines */

glFlush ();

void init (void) {

/* select clearing color */

glClearColor (0.0, 0.0, 0.0, 0.0);

/* initialize viewing values */

glMatrixMode(GL_PROJECTION);

glLoadIdentity();
47

glOrtho(0.0, 1.0, 0.0, 1.0, -1.0, 1.0);

A Simple OpenGL Program (3)

/* Declare initial window size, position, and display mode (single

buffer and RGBA). Open window with "hello" in its title bar. Call

initialization routines. Register callback function to display graphics.

Enter main loop and process events. */

int main(int argc, char** argv)

glutInit(&argc, argv);

glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB);

glutInitWindowSize (250, 250);

glutInitWindowPosition (100, 100);

glutCreateWindow ("hello");

init ();

glutDisplayFunc(display);

glutMainLoop();

return 0; /* ANSI C requires main to return int. */

The following procedure takes as input three points and returns the coefficients of the Cartesian plane
equation (a,b,c and d).

TYPE Vector = Array [0..2] of REAL;


PROCEDURE PlaneEquation(P1,P2,P3: Vector;VAR a,b,c,d: REAL);
VAR d1,d2: Vector;
(* Find two vectors parallel to the plane *)
FOR j:0 .. 2
d1[j] = P2[j]-P1[j];
48

d2[j] = P3[j]-P1[j];
END FOR
(* Find the normal vector to the plane n = [a,b,c] = d1 X d2 *)
a := d1[1]*d2[2] - d1[2]*d2[1]
b := d1[2]*d2[0] - d1[0]*d2[2]
c := d1[0]*d2[1] - d1[1]*d2[0]
(* take the dot product with P-P1 *)
d := -(a*P1[0]+b*P1[1]+c*P1[2])

END PlaneEquation;
49

References
1. What is Computer Graphics?, Cornell University Program of Computer Graphics. Last updated
04/15/98. Accessed Nov 17, 2009.
2. University of Leeds ISS (2002). "What are computer graphics?". Last updated: 22 Sep 2008
3. Michael Friendly (2008). "Milestones in the history of thematic cartography, statistical graphics, and
data visualization".
4. Ira Greenberg (2007). Processing: Creative Coding and Computational Art. Apress.
ISBN 159059617X.
[Link]
graphic&lr=&as_brr=0&ei=llOVR5LKCJL0iwGZ8-ywBw&sig=YEjfPOYSUDIf1CUbL5S5Jbzs7M8.
5. Rudolf F. Graf (1999). Modern Dictionary of Electronics. Oxford: Newnes. p. 569. ISBN 0-7506-
43315.
[Link]
nary+of+Electronics%22+inauthor:graf&lr=&as_brr=0&ei=5ygASM3qHoSgiwH45-GIDA&sig=7tg-
LuGdu6Njypaawi2bbkeq8pw.
6. Blythe, David. Advanced Graphics Programming Techniques Using OpenGL. Siggraph 1999. (see:
Multitexture)
7. Best Practices Memo
8. Choosing a venue: conference or journal?
9. Graphics/vision publications acceptance rates statistics
10. An extensive history of computer graphics can be found at this page.
11. Ron Fedkiw
12. SIGGRAPH 2001 Course on Digital Geometry Processing
13. CS 598: Digital Geometry Processing (Fall 2004)
[Link]
14. Digital Geometry Processing
15. Discrete Differential Geometry
50

Exercises

1. The term computer graphics has been used in a broad sense to describe "almost everything on
computers that is not text or sound." Briefly explain.
2. An object is located at point P (3,4) in a two dimensional plane. If the object is rotated
counterclockwise by 15o, find the new coordinate of the point P’ in two decimal place
showing a schematic diagram of the solution.
3. What are the areas of applications of computer graphics?
4. A square is located in a two dimensional plane with vertexes (A,B,C and D) with the
following coordinates: A(1,4); B(3,4); C(3,2) and D(1,2). Draw a schematic of the square. If
the object is to be scaled with the scaling factors: Sx = 2 and Sy = 1, Show the new dimension
and coordinates of the transformed object with the aid of a schematic diagram. Show all
calculations
5. Write short notes on the studies connected with Computer Graphics
6. Write a procedure in any programming language you like which takes as input three points
and returns the coefficients of the Cartesian plane equation (a,b,c and d).
7. Briefly state the classification of major subfields in computer graphics
8. Image representation can be accomplished using direct coding and lookup table. Explain these
techniques stating the advantage(s) and disadvantage(s) of each over the other.
9. If we use direct coding of RGB values with 2 bits per primary color, how many possible
colors do we have for each pixel? Show a tabular representation to demonstrate your solution.
10. A total of 32 bits per pixel is used in a direct coding method. If 10 bits each is used for cyan
and magenta and 12 bits for yellow, how many possible simultaneous colors do we have?
11. Give a brief Historical account of Computer Graphics
12. Compute the size of an image that has 512 X 512 pixels at 256 pixels per inch.
13. Find the RGB coordinates of a color at (0.5, 0, 0.2) in the CMY coordinate
14. An object is located at a point P (2,2) in a two dimensional plane, if the object is translated to
a new point P’ (3,3), calculate the distance between P and P’.

You might also like