0% found this document useful (0 votes)
13 views55 pages

CG-Unit V

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)
13 views55 pages

CG-Unit V

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
You are on page 1/ 55

Unit V

Color Models
Color models,cont’d
Different meanings of color:
• painting
• wavelength of visible light
• human eye perception
Physical properties of light

Visible light is part of the electromagnetic radiation (380-750


nm)
1 nm (nanometer) = 10-10 m (=10-7 cm)
1 Å (angstrom) = 10 nm
Radiation can be expressed in wavelength (λ) or frequency (f),
c=λf, where c=3.1010 cm/sec
Physical properties of light

White light consists of a


spectrum of all visible
colors
Physical properties of light

All kinds of light can be


described by the energy
of each wavelength
The distribution showing
the relation between
energy and wavelength
(or frequency) is called
energy spectrum
Physical properties of light

This distribution may indicate:


1) a dominant wavelength (or frequency) which is the color of the
light (hue), cp. ED
2) brightness (luminance), intensity of the light (value), cp. the area A
3) purity (saturation), cp. ED - EW
Physical properties of light

Energy spectrum for a light source with a dominant


frequency near the red color
Material properties
The color of an object depends on the so called spectral curves for
transparency and reflection of the material
The spectral curves describe how light of different wavelengths are
refracted and reflected (cp. the material coefficients introduced in the
illumination models)
Properties of reflected light
Incident white light upon an object is for some wavelengths absorbed,
for others reflected
E.g. if all light is absorbed => black
If all wavelengths but one are absorbed => the one color is observed as
the color of the object by the reflection
Color definitions
Complementary colors - two colors combine to produce white light
Primary colors - (two or) three colors used for describing other colors
Two main principles for mixing colors:
• additive mixing
• subtractive mixing
Additive mixing
• pure colors are put close to each other => a mix on the retina
of the human eye (cp. RGB)
• overlapping gives yellow, cyan, magenta and white
• the typical technique on color displays
Subtractive mixing
• color pigments are mixed directly in some liquid, e.g. ink
• each color in the mixture absorbs its specific part of the incident light
• the color of the mixture is determined by subtraction of colored light,
e.g. yellow absorbs blue => only red and green, i.e. yellow, will reach the
eye (yellow because of addition)
Subtractive mixing,cont’d
• primary colors: cyan, magenta and yellow, i.e. CMY
• the typical technique in printers/plotters
• connection between additive and subtractive primary colors (cp. the
color models RGB and CMY)
Additive/subtractive mixing
Human color seeing
The retina of the human eye consists of cones
(7-8M),”tappar”, and rods (100-120M), ”stavar”,
which are connected with nerve fibres to the brain
Human color seeing,cont’d
Theory: the cones consist of various light absorbing material
The light sensitivity of the cones and rods varies with the wavelength, and
between persons
The ”sum” of
• the energy spectrum of the light
• the reflection spectrum of the object
• the response spectrum of the eye
decides the color perception for a person
Overview of color models
The human eye can perceive about 382000(!) different colors
Necessary with some kind of classification sys-tem; all using three
coordinates as a basis:
1) CIE standard
2) RGB color model
3) CMY color model (also, CMYK)
4) HSV color model
5) HLS color model
CIE standard
Commission
Internationale de
L’Eclairage (1931)
• not a computer model
• each color = a weighted
sum of three imaginary
primary colors
RGB model
• all colors are generated
from the three
primaries
• various colors are
obtained by changing
the amount of each
primary
• additive mixing (r,g,b),
0≤r,g,b≤1
RGB model,cont’d
• the RGB cube
• 1 bit/primary => 8 colors, 8 bits/primary => 16M colors
CMY model
• cyan, magenta and
yellow are
comple-mentary colors
of red,green and blue,
respectively
• subtractive mixing
• the typical printer
technique
CMY model,cont’d
• almost the same cube
as with RGB; only
black<-> white
• the various colors are
obtained by reducing
light, e.g. if red is
absorbed => green and
blue are added, i.e cyan
RGB vs CMY
If the intensities are represented as 0≤r,g,b≤1 and
0≤c,m,y≤1 (also coordinates 0-255 can be used),
then the relation between RGB and CMY can be
described as:
CMYK model
For printing and graphics art industry, CMY is not enough; a fourth
primary, K which stands for black, is added.
Conversions between RGB and CMYK are possible, although they
require some extra processing.
HSV model
• HSV stands for Hue-Saturation-Value
• described by a hexcone derived from the RGB cube
HSV model,cont’d
• Hue (0-360°); ”the
color”, cp. the
dominant wave-length
(128)
• Saturation (0-1); ”the
amount of white” (130)
• Value (0-1); ”the
amount of black” (23)
HSV model,cont’d
The numbers given after each ”primary” are estimates of how many levels
a human being is capable to distinguish between, which (in theory) gives
the total number of color nuances:
128*130*23 = 382720
In Computer Graphics, usually enough with:
128*8*15 = 16384
HLS model
Another model similar to
HSV
L stands for Lightness
Color models
Some more facts about colors:
The distance between two colors in the color cube is not a measure of
how far apart the colors are perceptionally!
Humans are more sensitive to shifts in blue (and green?) than, for
instance, in yellow
•COMPUTER ANIMATIONS
Computer Animations

• Any time sequence of visual changes in a scene.


• Size, color, transparency, shape, surface texture, rotation, translation,
scaling, lighting effects, morphing, changing camera parameters(position,
orientation, and focal length), particle animation.

• Design of animation sequences:


• Storyboard layout
• Object definitions
• Key-frame specifications
• generation of in-between frames
Computer Animations
• Frame by frame animation
• Each frame is separately generated.
• Object defintion
• Objects are defined interms of basic shapes, such as polygons or
splines. In addition the associated movements for each object are
specified along with the shape.
• Storyboard
• It is an outline of the action
• Keyframe
• Detailed drawing of the scene at a particular instance
Computer Animations
• Inbetweens
• Intermediate frames (3 to 5 inbetweens for each two key frames)
• Motions can be generated using 2D or 3D transformation
• Object parameters are stored in database
• Rendering algorithms are used finally
• Raster animations:
• Uses raster operations.
• Ex: we can animate objects along 2D motion paths using the color
table transformations. Here we predefine the object at successive
positions along the motion path, and set the successive blocks of pixel
values to color table entries
Computer Animations

• Computer animation languages:


A typical task in animation specification is
• Scene description – includes position of objects and light sources,
defining the photometric parameters and setting the camera
parameters.
• Action specification – this involves layout of motion paths for the
objects and camera. We need viewing and perspective transformations,
geometric transformations, visible surface detection, surface rendering,
kinematics etc.,
• Keyframe systems – designed simply to generate the in-betweens from
the user specified key frames.
Computer Animations
• Computer animation languages:
A typical task in animation specification is
• Parameterized systems – allow object motion characteristics to be
specified as part of the object definitions. The adjustable parameters
control such object charateristics as degrees of freedom, motion
limitations and allowable shape changes.
• 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.
Computer Animations
Interpolation techniques Linear
Computer Animations
Interpolation techniques Non-linear
Computer Animations
• Key frame systems
• Morphing – Transformation of object shapes from one form to another is called
morphing.
• Given two keyframes for an object transformation, we first adjust the object
specification in one of the frames so that number of polygon edges or vertices is the
same for the two frames.
• Let Lk,Lk+1 denote the number of line segments in two different frames K,K+1
• Let us define
1’
• Lmax=max(Lk,Lk+1) 1
• Lmin=min(Lk,Lk+1) 3’
• Ne = Lmax mod Lmin
Ns = int(Lmax / Lmin)
• 2 2’
Key frame K
Key frame K+1
Computer Animations
• Steps
• 1. Dividing Ne edges of keyframemin into Ns+1 sections
• 2. Dividing the remaining lines of keyframemin into Nssections

1’
1
3’

2 2’
Key frame K
Key frame K+1
Computer Animations
• Key frame systems
• Morphing – Transformation of object shapes from one form to another is called
morphing.
• If we equalize the vertex count, then the similar analysis follows
• Let Vk,Vk+1 denote the number of vertices in two different frames K,K+1
• Let us define
• Vmax=max(Lk,Lk+1)
• Vmin=min(Lk,Lk+1)
• Nls = (Vmax –1)mod (Vmin –1)
Np = int((Vmax –1) / (Vmin –1)
• Steps
• 1. adding Np points to Nls line sections of keyframemin sections
• 2. Adding Np-1 points to the remaining edges of keyframemin
Computer Animations
• Simulating accelerations
• Curve fitting techniques are often used to specify the animation paths between keyframes.
• To simulate accelerations we can adjust the time spacing for the in-betweens. For constant speed we use equal
interval time spacing for the inbetweens.
• suppose we want ‘n’ in-betweens for keyframes at times t1 and t2. The time intervals between key frames is then
divided into n+1 sub intervals, yielding an in-between spacing of
• δ t = t2-t1/(n+1)
• We can calculate the time for in-betweens as
• tBj=t1+j δ t for j=1,2,…….,n

δt


Computer Animations
• Simulating accelerations
• To model increase or decrease in speeds we use trignometric functions.
• To model increasing speed, we want the time spacing between frames to increase so that greater changes in position occur as
the object moves faster.
• We can obtain increase in interval size with the function
• 1-cosθ, 0< θ<Π/2
• For n-inbetweens the time for the jth inbetween would then be calculated as
• tBj=t1+δt(1-cosj Π/2(n+1))
• j=1,2,…….,n
• For j=1
tB1=t1+δt(1-cos Π/2(n+1))
• For j=1
tB2=t1+δt(1-cos 2Π/2(n+1))
• where δt is the time difference
• between any two key frames.
Computer Animations
• Simulating deccelerations
• To model increase or decrease in speeds we use trignometric functions.
• To model decreasing speed, we want the time spacing between frames to
decrease. We can obtain increase in interval size with the function
• sinθ, 0< θ<Π/2
• For n-inbetweens the
• time for the jth inbetween would
• then be calculated as
• tBj=t1+δt.sinj Π/2(n+1))
• j=1,2,…….,n
Computer Animations
• Simulating both accelerations and deccelerations
• To model increase or decrease in speeds we use trignometric functions.
• A combination of increasing and decreasing
• speeds can be modeled using
• ½(1-cosθ) 0< θ<Π/2
• The time for the jth inbetween is calculated as
• tBj=t1+δt 1-cos j[Π(n+1)/2)
• j=1,2,…….,n
Computer Animations
• Motion specifications
• Direct motion specifications
• Here we explicitly give the rotation angles and translation vectors. Then the
geometric transformation matrices are applied to transform coordinate positions.
• A bouncing ball can be approximated by a sine curve
• y(x)=AI(sin(ωx+θ0)Ie-kx
• A is the initial amplitude
• ω is the angular frequency
• θ0 is the phase angle
• K is the damping constant
Computer Animations
• Motion specifications
• Goal directed systems
• We can specify the motions that are to take place in general terms that
abstractly describe the actions, because they determine specific motion
paramters given the goals of the animation.
Computer Animations
• Motion specifications
• Kinematics
• Kinematic specification of of a motion can also
be given by simply describing the motion path
which is often done using splines.
• In inverse kinematics we specify the intital and
final positions of objects at specified times and the
motion parameters are computed by the system.
Computer Animations
• Motion specifications
• dynamics
• specification of the forces that produce the velocities and accelerations.
Descriptions of object behavior under the influence of forces are generally
referred to as a Physically based modeling (.rigid body systems and non rigid
systems such as cloth or plastic)
• Ex: magnetic, gravitational, frictional etc
• We can also use inverse dynamics to obtain the forces, given the initial and final
position of objects and the type of motion.
Computer Animations
•Ideally suited for:
Physics based animations
•Large volumes of objects – wind effects, liquids,
•Cloth animation/draping
•Underlying mechanisms are usually:
•Particle systems
•Mass-spring systems
Computer Animations
Physics based animations
Computer Animations

Physics based animations


Computer Animations

Some more animation


techniques………….

Anticipation and Staging


Computer Animations

Some more animation


techniques………….

Secondary Motion
Computer Animations

Some more animation


techniques………….

Motion Capture

You might also like