CG Unit4
CG Unit4
Light sources, basic illumination models, halftone patterns and dithering techniques; Properties of light,
Diffused illumination, point source illumination, Standard primaries and chromaticity diagram; Intuitive colour
concepts, RGB colour model, YIQ colour model, CMY colour model ,HSV colour model; Colour selection,
ray tracing.
Illumination model
Illumination model also known as Shading model or Lightning model, is used to
calculate the intensity of light that is reflected at a given point on surface. There are
three factors on which lightning effect depends on:
1. Light Source :
Light source is the light emitting source. There are three types of light
sources:
1. Point Sources – The source that emit rays in all directions (A
bulb in a room).
2. Parallel Sources – Can be considered as a point source which
is far from the surface (The sun).
3. Distributed Sources – Rays originate from a finite area (A
tubelight).
Their position, electromagnetic spectrum and shape determine the
lightning effect.
2. Surface :
When light falls on a surface part of it is reflected and part of it is
absorbed. Now the surface structure decides the amount of reflection and
absorption of light. The position of the surface and positions of all the
nearby surfaces also determine the lightning effect.
3. Observer :
The observer’s position and sensor spectrum sensitivities also affect the
lightning effect.
1. Ambient Illumination :
Assume you are standing on a road, facing a building with glass exterior and sun
rays are falling on that building reflecting back from it and the falling on the object
under observation. This would be Ambient Illumination. In simple words, Ambient
Illumination is the one where source of light is indirect.
The reflected intensity I amb of any point on the surface is:
2. Diffuse Reflection :
Diffuse reflection occurs on the surfaces which are rough or grainy. In this reflection
the brightness of a point depends upon the angle made by the light source and the
surface.
The reflected intensity I diff of a point on the surface is:
3. Specular Reflection :
When light falls on any shiny or glossy surface most of it is reflected back, such
reflection is known as Specular Reflection.
Phong Model is an empirical model for Specular Reflection which provides us with
the formula for calculation the reflected intensity I spec:
Color Models
Color Model is a method for explaining the properties or behavior of color within some
particular context. No single color model can explain all aspects of color, so we make use of
different models to help describe the different perceived characteristics of color.
Properties of Light
Other frequency bands within this spectrum are called radio waves, micro waves, infrared
waves and x-rays. The below fig shows the frequency ranges for some of the
electromagnetic bands.
Each frequency value within the visible band corresponds to a distinct color.
At the low frequency end is a red color (4.3*104 Hz) and the highest frequency is a violet color
(7.5 *10 14Hz)
Spectral colors range from the reds through orange and yellow at the low frequency end to
greens, blues and violet at the high end.
Since light is an electro magnetic wave, the various colors are described in terms of either the
frequency for the wave length λ of the wave.
The wave length ad frequency of the monochromatic wave are inversely proportional to each
other, with the proportionality constants as the speed of light
C where C = λ f
A light source such as the sun or a light bulb emits all frequencies within the visible range to
produce white light. When white light is incident upon an object, some frequencies are reflected
and some are absorbed by the object. The combination of frequencies present in the reflected
light determines what we perceive as the color of the object.
If low frequencies are predominant in the reflected light, the object is described as red. In this
case, the perceived light has the dominant frequency at the red end of the spectrum. The
dominant frequency is also called the hue, or simply the color of the light.
Intensity in the radiant energy emitted per limit time, per unit solid angle, and per unit projected
area of the source.
o Purity describes how washed out or how pure the color of the light appears.
The term chromaticity is used to refer collectively to the two properties, purity and
dominant frequency.
Two different color light sources with suitably chosen intensities can be used to produce
a range of other colors.
If the 2 color sources combine to produce white light, they are called complementary
colors. E.g., Red and Cyan, green and magenta, and blue and yellow.
Color models that are used to describe combinations of light in terms of dominant
frequency use 3 colors to obtain a wide range of colors, called the color gamut.
The 2 or 3 colors used to produce other colors in a color model are called primary colors.
Standard Primaries
XYZ Color
The set of primaries is generally referred to as the XYZ or (X,Y,Z) color model
where X,Y and Z represent vectors in a 3D, additive color space.
Any color Cλ is expressed as
Cλ = XX + YY + ZZ------------- (1)
Where X,Y and Z designates the amounts of the standard primaries needed
to match Cλ.
with x + y + z = 1
Any color can be represented with just the x and y amounts. The parameters x and y
are called the chromaticity values because they depend only on hue and purity.
If we specify colors only with x and y, we cannot obtain the amounts X, Y and Z. so,
a complete description of a color in given with the 3 values x, y and Y.
X = (x/y)Y, Z = (z/y)Y
Where z = 1-x-y.
Color paintings can be created by mixing color pigments with white and black
pigments to form the various shades, tints and tones.
Starting with the pigment for a „pure color‟ the color is added to black pigment to
produce different shades. The more black pigment produces darker shades.
Different tints of the color are obtained by adding a white pigment to the original color,
making it lighter as more white is added.
Tones of the color are produced by adding both black and white pigments.
RGB Color Model
Based on the tristimulus theory of version, our eyes perceive color through the
stimulation of three visual pigments in the cones on the retina.
These visual pigments have a peak sensitivity at wavelengths of about 630 nm (red), 530
nm (green) and 450 nm (blue).
This is the basis for displaying color output on a video monitor using the 3 color primaries,
red, green, and blue referred to as the RGB color model. It is represented in the below
figure
Vertices of the cube on the axes represent the primary colors, the remaining vertices
represents the complementary color for each of the primary colors.
The RGB color scheme is an additive model. (i.e.,) Intensities of the primary colors are
added to produce other colors.
Each color point within the bounds of the cube can be represented as the triple (R,G,B)
where values for R, G and B are assigned in the range from 0 to1.
Cλ = RR + GG + BB
The magenta vertex is obtained by adding red and blue to produce the triple (1,0,1) and
white at (1,1,1) in the sum of the red, green and blue vertices.
Shades of gray are represented along the main diagonal of the cube from the origin (black)
to the white vertex.
YIQ Color Model
The National Television System Committee (NTSC) color model for forming the
composite video signal in the YIQ model.
raphics Unit 3
In the YIQ color model, luminance (brightness) information in contained in the Y
parameter, chromaticity information (hue and purity) is contained into the I and Q
parameters.
A combination of red, green and blue intensities are chosen for the Y parameter to yield
the standard luminosity curve.
Since Y contains the luminance information, black and white TV monitors use only the Y
signal.
Parameter I contain orange-cyan hue information that provides the flash-tone shading and
occupies a bandwidth of 1.5 MHz.
Parameter Q carries green-magenta hue information in a bandwidth of about 0.6MHz.
A color model defined with the primary colors cyan, magenta, and yellow (CMY) in
useful for describing color output to hard copy devices.
It is a subtractive color model (i.e.,) cyan can be formed by adding green and blue light.
When white light is reflected from cyan-colored ink, the reflected light must have no red
component. i.e., red light is absorbed or subtracted by the link.
Magenta ink subtracts the green component from incident light and yellow subtracts the
blue component.
In CMY model, point (1,1,1) represents black because all components of the incident
light are subtracted.
The origin represents white light.
Equal amounts of each of the primary colors produce grays along the main diagonal of
the cube.
A combination of cyan and magenta ink produces blue light because the red and green
components of the incident light are absorbed.
The printing process often used with the CMY model generates a color point with a
collection of 4 ink dots; one dot is used for each of the primary colors (cyan, magenta and
yellow) and one dot in black.
Where the white is represented in the RGB system as the unit column vector.
Where black is represented in the CMY system as the unit column vector.
The HSV model uses color descriptions that have a more interactive appeal to a user.
Color parameters in this model are hue (H), saturation (S), and value (V). The 3D
representation of the HSV model is derived from the RGB cube. The outline of the
cube has the hexagon shape.
The boundary of the hexagon represents the various hues, and it is used as the
top of the HSV hexcone.
In the hexcone, saturation is measured along a horizontal axis, and value is along a
vertical axis through the center of the hexcone.
Hue is represented as an angle about the vertical axis, ranging from 00 at red
through 3600. Vertices of the hexagon are separated by 600 intervals. Yellow is at
600, green at 1200 and cyan opposite red at H = 1800. Complementary colors are
1800 apart.
The remaining colors are specified around the perimeter of the cone in the same order as in
the HSV model.
The vertical axis is called lightness (L). At L = 0, we have black, and white is at L
= 1 Gray scale in along the L axis and the “purehues” on the L = 0.5 plane.
LP 7: Animation
Example : Advertising animations often transition one object shape into another.
Frame-by-Frame animation
Each frame of the scene is separately generated and stored. Later, the frames can be
recoded on film or they can be consecutively displayed in "real-time playback" mode
It defines the motion sequences as a set of basic events that are to take place.
Depending on the type of animation to be produced, the story board could consist
of a set of rough sketches or a list of the basic ideas for the motion.
Object Definition
The associated movements of each object are specified along with the shape.
Key frame
A key frame is detailed drawing of the scene at a certain time in the animation
sequence.
Within each key frame, each object is positioned according to the time for that frame.
Some key frames are chosen at extreme positions in the action; others are spaced so that
the time interval between key frames is not too much.
In-betweens
Film requires 24 frames per second and graphics terminals are refreshed at the rate of
30 to 60 frames per seconds.
Time intervals for the motion are setup so there are from 3 to 5 in-between for each
pair of key frames.
Depending on the speed of the motion, some key frames can be duplicated.
For a 1 min film sequence with no duplication, 1440 frames are needed.
□ Motion verification
□ Editing
□ Camera motion
□ Generation of in-betweens
Animation packages such as wave front provide special functions for designing the
animation and processing individuals objects.
Object shapes and associated parameter are stored and updated in the database.
Standard functions can be applied to identify visible surfaces and apply the
rendering algorithms.
Camera movement functions such as zooming, panning and tilting are used for
motion simulation.
Given the specification for the key frames, the in-betweens can be automatically
generated.
Raster Animations
Sequence of raster operations can be executed to produce real time animation of either
2D or 3D objects.
□ Predefine the object as successive positions along the motion path, set the
successive blocks of pixel values to color table entries.
□ Set the pixels at the first position of the object to „on‟ values, and set the pixels at
the other object positions to the background color.
□ The animation is accomplished by changing the color table values so that the
object is „on‟ at successive positions along the animation path as the preceding
position is set to the background intensity.
Animation functions include a graphics editor, a key frame generator and standard
graphics routines.
The graphics editor allows designing and modifying object shapes, using spline surfaces,
constructive solid geometry methods or other representation schemes.
Scene description includes the positioning of objects and light sources defining the
photometric parameters and setting the camera parameters.
Action specification involves the layout of motion paths for the objects and camera.
Keyframe systems are specialized animation languages designed dimply to generate the
in-betweens from the user specified keyframes.
Scripting systems allow object specifications and animation sequences to be defined with
a user input script. From the script, a library of various objects and motions can be
constructed.
Keyframe Systems
Each set of in-betweens are generated from the specification of two keyframes.
For complex scenes, we can separate the frames into individual components or objects
called cells, an acronym from cartoon animation.
Morphing
If the vector counts in equalized parameters Vk and Vk+1 are used to denote the
number of vertices in the two consecutive frames. In this case we define
Vmax = max(Vk,Vk+1), Vmin = min( Vk,Vk+1) and
Simulating Accelerations
Curve-fitting techniques are often used to specify the animation paths between key frames.
Given the vertex positions at the key frames, we can fit the positions with linear or nonlinear
paths. Figure illustrates a nonlinear fit of key-frame positions. This determines the trajectories
for the in-betweens. To simulate accelerations, we can adjust the time spacing for the in-
betweens.
For constant speed (zero acceleration), we use equal-interval time spacing for the in-
betweens. Suppose we want n in-betweens for key frames at times t1 and t2.
The time interval between key frames is then divided into n + 1 subintervals, yielding an in-
between spacing of
∆= t2-t1/n+1
Motion Specification
These are several ways in which the motions of objects can be specified in an
animation system.
Here the rotation angles and translation vectors are explicitly given.
We can approximate the path of a bouncing ball with a damped, rectified, sine curve
where A is the initial amplitude, ω is the angular frequency, θ0 is the phase angle and k is the
damping constant.