0% found this document useful (0 votes)
128 views56 pages

Computer Graphics Unit 5 Complete Notes (RRSIMT Classes)

The document discusses hidden lines and surfaces in computer graphics, explaining that hidden lines are edges not visible from a certain viewpoint, while hidden surfaces are entire faces obscured from view. It also covers back-face detection methods to improve rendering efficiency by ignoring hidden faces, and introduces Z-buffer and A-buffer techniques for managing visibility and transparency in 3D graphics. These methods enhance realism and performance in rendering processes by determining which parts of objects should be displayed based on their depth and visibility.
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)
128 views56 pages

Computer Graphics Unit 5 Complete Notes (RRSIMT Classes)

The document discusses hidden lines and surfaces in computer graphics, explaining that hidden lines are edges not visible from a certain viewpoint, while hidden surfaces are entire faces obscured from view. It also covers back-face detection methods to improve rendering efficiency by ignoring hidden faces, and introduces Z-buffer and A-buffer techniques for managing visibility and transparency in 3D graphics. These methods enhance realism and performance in rendering processes by determining which parts of objects should be displayed based on their depth and visibility.
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

Computer Graphics(BCS053)

Unit-5 Hidden Lines &


Surfaces

Edushine Classes

Follow Us
Free Notes Available on : [Link]
[Link]
Computer Graphics: Unit-5

What are Hidden Lines and Hidden Surfaces?


When you look at an object, you can only see the parts that face you. The
parts behind it are hidden from view.
For example:
Imagine holding a box (like a shoe box) in your hand.
->From the front, you can see: The top face, The front face,The right or left
face (depending on your angle).
But you can’t see:
The back face, The bottom face, The other side face (if it’s blocked by the
front). These parts that you can’t see are called hidden lines (edges) or
hidden surfaces (entire areas).

RRSIMT CLASSES WHATSAPP


Free Notes - 9795358008
Available Follow Us
on : [Link]
Computer Graphics: Unit-5

Key Difference Between Hidden Lines and Surfaces


->Hidden Lines: These are just the edges that you can’t see. (Think of the back edge of a
cube.)
->Hidden Surfaces: These are entire areas or faces that you can’t see. (Think of the back
face of a cube.)

RRSIMT CLASSES WHATSAPP


Free Notes - 9795358008
Available Follow Us
on : [Link]
Computer Graphics: Unit-5

 Hidden Lines Example in Drawing -


If you’re drawing this previous box:
-> The edges (lines) you can see are drawn as solid lines.
-> The edges (lines) you can’t see (hidden behind other surfaces) are
shown as dashed lines.
This helps anyone looking at your drawing understand that there are
hidden parts of the object, even though they are not directly visible.

RRSIMT CLASSES WHATSAPP


Free Notes - 9795358008
Available Follow Us
on : [Link]
Computer Graphics: Unit-5

 Hidden Surfaces Example in Graphics :


Let’s say you’re making a 3D model of the box on a computer.

1.A 3D model includes all surfaces (front, back, top, bottom, etc.).
[Link] when you render (finalize) the model, the computer hides the
surfaces that are behind the visible parts.

For example, the back face of the box will not be displayed because it’s
hidden behind the front face. This makes the box look realistic.

RRSIMT CLASSES WHATSAPP


Free Notes - 9795358008
Available Follow Us
on : [Link]
Computer Graphics: Unit-5

Back face Detection (Removal) Methods :


What is Back-face Detection?
Imagine you're holding a transparent cube in your hand. You can see both
the front side of the cube and the back side through it, but in a normal 3D
rendering (like in a game), you don’t need to see the back side because it’s
hidden.
Back-face detection is a method that helps the computer figure out which
parts of an object are:
->Facing you (visible).
->Facing away from you (hidden and not drawn)

RRSIMT CLASSES WHATSAPP


Free Notes - 9795358008
Available Follow Us
on : [Link]
Computer Graphics: Unit-5

Why Do We Use Back-face Detection?


In computer graphics:
Objects have many faces (like the six faces of a cube).
If we try to draw all the faces, including the ones you can’t see, it takes more
time and makes things slower.
So, back-face detection ignores the hidden faces, making the process faster
and more realistic.

RRSIMT CLASSES WHATSAPP


Free Notes - 9795358008
Available Follow Us
on : [Link]
Computer Graphics: Unit-5

How Does Back-face Detection Work?(Algorithm)


To figure out if a face of an object is visible or hidden, the computer uses a
method involving vectors and math.
 Step 1: Understand the Normal Vector
Each face of a 3D object has something called a normal vector.
The normal vector is like an arrow that points straight out from the face,
showing which direction the face is "facing."
Example: Imagine holding a book with its cover facing you.
-> The normal vector of the front cover points toward you because it’s
visible.
->The normal vector of the back cover points away from you because it’s
hidden.
RRSIMT CLASSES WHATSAPP
Free Notes - 9795358008
Available Follow Us
on : [Link]
Computer Graphics: Unit-5

 Step 2: Use the Camera’s View


In a 3D scene, there’s a camera (your viewpoint).
The computer compares the direction of the normal vector with the
direction of the camera’s view. This comparison tells the computer if the
face is facing you or facing away.

RRSIMT CLASSES WHATSAPP


Free Notes - 9795358008
Available Follow Us
on : [Link]
Computer Graphics: Unit-5

 Step 3: Do the Math (Dot Product)


The computer calculates the dot product between:
->The normal vector(N) (direction of the face).
->The view vector(V) (direction of the camera).

The dot product gives one of these results:


 Positive value: The face is visible because it’s facing the camera.
 Negative value: The face is hidden because it’s facing away from the
camera.
If the dot product is negative, the computer skips drawing that face!

RRSIMT CLASSES WHATSAPP


Free Notes - 9795358008
Available Follow Us
on : [Link]
Computer Graphics: Unit-5

The sign of N⋅V tells us whether the face is visible:


1. If N.V > 0 –
The face is visible because the normal vector is pointing towards
the viewer.
2. If N.V < 0 –
The face is hidden because the normal vector is pointing away
from the viewer.
3. If N.V = 0 –
The face is parallel to the view direction and may not be visible.

RRSIMT CLASSES WHATSAPP


Free Notes - 9795358008
Available Follow Us
on : [Link]
Computer Graphics: Unit-5
Example with a Cube
Let’s say you’re looking at a cube. The cube has 6 faces:
i. Front face (visible).
ii. Back face (hidden).
[Link] face (visible).
iv. Bottom face (hidden).
v. Left face (visible).
vi. Right face (visible).
The normal vector of the front face points toward you → draw it.
The normal vector of the back face points away from you → skip it.

RRSIMT CLASSES WHATSAPP


Free Notes - 9795358008
Available Follow Us
on : [Link]
Computer Graphics: Unit-5

 Advantages of Back-face Detection -


i. Saves Time:
By ignoring hidden faces, the computer spends less time drawing
unnecessary parts of an object.
ii. Makes Rendering Faster:
If you’re creating a game or 3D animation, this method speeds up the entire
rendering process.
iii. Improves Realism:
Only the visible parts of objects are shown, making the 3D scene look
realistic.

RRSIMT CLASSES WHATSAPP


Free Notes - 9795358008
Available Follow Us
on : [Link]
Computer Graphics: Unit-5

 Z- Buffer ( Depth Buffer) Methods :


When you look at a 3D object in a game or animation, some parts are closer
to you, and others are farther away. The Z-buffer method helps the
computer decide which parts of the object you can see and which parts are
hidden behind other objects.
What is the Problem?
Imagine you’re standing in front of two walls:
->The red wall is closer to you.
->The blue wall is behind the red wall.
When you look at them, you can only see the red wall because it blocks your
view of the blue wall. In a 3D scene, the computer has to figure this out for
every pixel on the screen. That’s where the Z-buffer method comes in.
RRSIMT CLASSES WHATSAPP
Free Notes - 9795358008
Available Follow Us
on : [Link]
Computer Graphics: Unit-5
 How Does the Z-Buffer Work?
1. Create Two Buffers:
Z-Buffer: This buffer tracks the distance (or depth) of each pixel from the
camera.
Initially, all positions in the Z-buffer are set to the farthest possible
value (like infinity).
Frame Buffer: This buffer stores the colors of the pixels that will be
displayed on the screen.
2. Render Each Object Pixel by Pixel:
The computer looks at every pixel of the objects in the scene one by one.
3. Calculate Depth (Z-Value):
For each pixel, the computer calculates its depth (distance from the
RRSIMT CLASSES WHATSAPP
Free Notes - 9795358008
Available Follow Us
on : [Link]
Computer Graphics: Unit-5

camera), called the Z-value.


4. Compare Depths:
The Z-value of the current pixel is compared with the value already stored
in the Z-buffer.
-> If the current pixel is closer (smaller Z-value):
Update the Z-buffer with this new Z-value.
Update the frame buffer with the color of the current pixel.
-> If the current pixel is farther away (larger Z-value):
Ignore the pixel because it is hidden by a closer object.
5. Display the Final Image:
After all objects are processed, the frame buffer contains the colors of
only the visible pixels, and this is displayed on the screen.
RRSIMT CLASSES WHATSAPP
Free Notes - 9795358008
Available Follow Us
on : [Link]
Computer Graphics: Unit-5
Example
Imagine there are two squares (one red, one blue) overlapping on the
screen:
-> Red Square is closer (Z=3).
-> Blue Square is farther (Z=7).
 For each overlapping pixel:
->The Z-buffer initially has Z=∞ (no objects yet).
->When the red square is processed:
The Z-buffer is updated to Z=3.
The frame buffer is updated to the red color.
-> When the blue square is processed:
Its Z-value (Z=7) is compared to the current Z-buffer value (Z=3).
RRSIMT CLASSES WHATSAPP
Free Notes - 9795358008
Available Follow Us
on : [Link]
Computer Graphics: Unit-5

Since 7>3, the blue square is ignored for this pixel.


The result: The pixel shows the red color because the red square is closer.

 Advantages
1. Simple Algorithm:
Easy for computers to understand and implement.
2. Efficient for Overlapping Objects:
Automatically hides parts of objects that are farther away.
3. Real-Time Performance:
Ideal for games and animations where speed is important.

RRSIMT CLASSES WHATSAPP


Free Notes - 9795358008
Available Follow Us
on : [Link]
Computer Graphics: Unit-5

 A (anti- aliasing ) Buffer Methods :


The A-buffer method is an improved version of the Z-buffer method. It
is used in computer graphics to handle hidden surface removal and
provides better quality by dealing with transparent objects.

What is the A-Buffer Method?


The A-buffer (short for "Anti-aliased Buffer") is a hidden surface removal
technique.
Unlike the Z-buffer, which stores only one depth value for each pixel, the A-buffer
can store multiple layers of information for each pixel. This makes it capable of
handling:
Transparent objects: Objects you can partially see through (like glass or water).
Anti-aliasing: Smoother edges for better visual quality.

RRSIMT CLASSES WHATSAPP


Free Notes - 9795358008
Available Follow Us
on : [Link]
Computer Graphics: Unit-5

 Why Do We Need the A-Buffer?


Z-buffer Limitation:
The Z-buffer works well for solid objects but cannot handle
transparency or overlapping objects with blended effects.
A-buffer Solution:
The A-buffer keeps track of all the fragments (pieces) of objects that
affect a pixel. It calculates their combined contribution to produce the
final color and depth.

Now Lets Understand its Algorithm how it is work ----

RRSIMT CLASSES WHATSAPP


Free Notes - 9795358008
Available Follow Us
on : [Link]
Computer Graphics: Unit-5

A buffer Algorithm Maintain two fields

Depth Field Contains Intensity Field Contain


+Ve or –Ve Value (intensity of Pixels)
Here Two Cases arises –
If d<0 – Multiple layer Exist
If d>0 – Single Layer exist

RRSIMT CLASSES WHATSAPP


Free Notes - 9795358008
Available Follow Us
on : [Link]
Computer Graphics: Unit-5
 How Does the A-Buffer Work?
1. Divide the Screen into Pixels:
The screen is divided into small squares called pixels.
2. Store a List of Fragments for Each Pixel:
For each pixel, the A-buffer stores all the fragments of objects that affect t
pixel. Each fragment contains:
Color: The color of the fragment.
Depth (Z-value): The distance of the fragment from the camera.
Opacity: How transparent the fragment is (0 = fully transparent,
1 = fully opaque).
3. Combine the Fragments:
The computer combines all fragments affecting a pixel to calculate:
RRSIMT CLASSES WHATSAPP
Free Notes - 9795358008
Available Follow Us
on : [Link]
Computer Graphics: Unit-5
The final color of the pixel.
The final depth of the visible surface.
4. Handle Transparency:
The fragments are blended based on their opacity and order (front to
back). For example:
A red glass object partially covers a blue background. The resulting
color will be a mix of red and blue, depending on the transparency of
the glass.
5. Anti-Aliasing:
The A-buffer averages the colors of neighboring fragments to remove
jagged edges and create smoother images.

RRSIMT CLASSES WHATSAPP


Free Notes - 9795358008
Available Follow Us
on : [Link]
Computer Graphics: Unit-5

6. Display the Final Image:


after processing all pixels, the final image is displayed with correct visibility
and smooth edges.

Example :
Imagine you’re looking at two overlapping objects:
->A glass window (transparent).
->A tree behind the glass.
Using the A-buffer:
The computer stores both the glass and the tree fragments for each pixel.
It calculates how much light passes through the glass to affect the color of
the tree The final color of each pixel is a combination of both objects.
RRSIMT CLASSES WHATSAPP
Free Notes - 9795358008
Available Follow Us
on : [Link]
Computer Graphics: Unit-5

RRSIMT CLASSES WHATSAPP


Free Notes - 9795358008
Available Follow Us
on : [Link]
Computer Graphics: Unit-5
 Advantages of A-Buffer
[Link] Transparency:
Works well with glass, water, and other transparent
objects.
[Link]-Quality Images:
Smooth edges and better visual quality.
[Link] Multiple Layers:
Can store and process overlapping objects.

RRSIMT CLASSES WHATSAPP


Free Notes - 9795358008
Available Follow Us
on : [Link]
Computer Graphics: Unit-5

Scan Line Methods :


->This algorithm is based on the Image-space method and concept of
coherence. As its name suggests itself Scan-line algorithm, so it processes
one line at a time rather than processing one pixel(a point on raster
display) at a time.

->The Scan Line Algorithm is used to figure out which parts of 3D objects
are visible and which are hidden when we look at them on a 2D screen. It
works row by row (scan line by scan line), checking all the objects' surfaces
to determine what should be drawn.

RRSIMT CLASSES WHATSAPP


Free Notes - 9795358008
Available Follow Us
on : [Link]
Computer Graphics: Unit-5

 What Is the Goal?


The goal is to figure out:
1. Which part of an object is visible (closer to the viewer).
2. Which part of an object is hidden (behind another object).

The algorithm processes one horizontal line (scan line) of the screen at a
time to find and color the visible parts.

RRSIMT CLASSES WHATSAPP


Free Notes - 9795358008
Available Follow Us
on : [Link]
Computer Graphics: Unit-5

 Scan line Algorithm :


1. Prepare Three Tables
i. Edge Table:
Keeps a list of all the edges (lines) of the objects.
Stores the starting and ending points of each edge and the slope (how
steep the edge is).
Example: If an edge connects points A(1,2)A(1, 2)A(1,2) and B(3,5)B(3,
5)B(3,5), it will store A,BA, BA,B and their x,yx, yx,y values.
2. Active Edge Table (AET):
Contains edges that are currently being processed by the scan line.
These are edges that the current scan line crosses.
Edges in this table are sorted from left to right.
RRSIMT CLASSES WHATSAPP
Free Notes - 9795358008
Available Follow Us
on : [Link]
Computer Graphics: Unit-5

[Link] Table
Contains details of each polygon (object surface), like:
Polygon ID (name of the polygon).
Depth (z-value): How far the polygon is from the viewer.
Color information (what color to use for this polygon).
Flag (on/off): Whether the polygon is visible at the current scan line.

RRSIMT CLASSES WHATSAPP


Free Notes - 9795358008
Available Follow Us
on : [Link]
Computer Graphics: Unit-5
2. Process Each Scan Line :
The algorithm processes one scan line at a time and follows these steps:
i. Find Intersecting Edges
Look at all edges in the Edge Table and find out which ones the current
scan line intersects.
Add these edges to the Active Edge Table (AET).
ii. Sort the Edges
Sort the edges in the Active Edge Table from left to right by their x-
coordinates (horizontal positions).
iii. Fill Visible Areas
Move from left to right across the scan line. For every visible part of a
polygon:
RRSIMT CLASSES WHATSAPP
Free Notes - 9795358008
Available Follow Us
on : [Link]
Computer Graphics: Unit-5

Check if there are overlapping polygons.


Compare their depth (z-value) at that point.
Keep the one that is closer to the viewer and color it on the
screen.
iv. Update Flags and Colors
If a polygon is completely visible at the scan line, set its flag = on.
Draw the polygon with its specific color in the refresh buffer (frame
buffer), which updates the screen.

RRSIMT CLASSES WHATSAPP


Free Notes - 9795358008
Available Follow Us
on : [Link]
Computer Graphics: Unit-5

Free Notes
RRSIMT CLASSES Available
WHATSAPP on : [Link]
– 9795358008 Follow us On
Computer Graphics: Unit-5

illumination Model
To Understand illumination Model first let understand the meaning of –

Shading Illumination(brightness) Intensity


चमक तीव्रता
Dark Portion Light Portion Quantity of illumination

Now What is actually illumination model means - Light Source

Illumination model, also known as Shading


model or Lighting model, is used to calculate
the intensity of light that is reflected at a given Intensity Value ? Can find by
point on surface. At this point (Obj) illumination
Model

Free Notes
RRSIMT CLASSES Available
WHATSAPP on : [Link]
– 9795358008 Follow us On
Computer Graphics: Unit-5
There are various Types of Illumination Models are as –
1. Ambient Light –
Ambient light is the light that is everywhere in the scene. It doesn’t
come from a specific source, but it’s scattered around, so it lights up
all objects evenly.
This is light that’s all around us. It doesn’t come from a specific
source like the sun or a lamp. It just fills the space evenly.
Example -
Imagine you’re inside a room with the lights off. You can still see
things around you, right? That’s because ambient light is present. It
could be the light coming in from outside through the windows, or
maybe from the streetlights outside.
Free Notes
RRSIMT CLASSES Available
WHATSAPP on : [Link]
– 9795358008 Follow us On
Computer Graphics: Unit-5

In computer graphics, ambient light makes sure that objects can still
be seen even if they are in the shadow or far from a direct light
source. It’s like the background light in the environment, making
everything a little bit visible.
Formula : I = Ka . Ia
Where:
•I is the total ambient light.
•Ka is the material's ambient reflection coefficient (how much
the surface reflects ambient light).
•Ia is the intensity of the ambient light.

Free Notes
RRSIMT CLASSES Available
WHATSAPP on : [Link]
– 9795358008 Follow us On
Computer Graphics: Unit-5
Object 1

2. Diffused illumination –
(Ambient Light )
Kisi object par jo light aa rhi hai
source se wo direct nahi aa rhi
pahle kisi object 1 par aa rhi the
reflect hokar then object 2 par aa Object 2
rhi hai,
Yahi hai diffused illumination .

Object 2 illuminate hua due to


diffusion.

Free Notes
RRSIMT CLASSES Available
WHATSAPP on : [Link]
– 9795358008 Follow us On
Computer Graphics: Unit-5

3. Diffused reflection -
Diffuse reflection is when light hits a rough or
matte surface and gets scattered in many
different directions. Instead of bouncing off the Light Reflect
surface in a single direction (like a mirror), the Intensity equal
light spreads out evenly. at every point

Diffuse reflection happens when light hits a


surface and spreads out evenly in all directions. Formula - I = Kd .Il . Cos(θ)
Where:
It doesn’t depend on where you’re looking •Is the total diffuse light.
from. •kd is the diffuse reflection coefficient.
•Il is the intensity of the light source.
•cos(θ) is the angle between the light direction and the surface normal
(perpendicular line to the surface).

Free Notes
RRSIMT CLASSES Available
WHATSAPP on : [Link]
– 9795358008 Follow us On
Computer Graphics: Unit-5

4. Specular Reflection?
Specular reflection happens when light hits a smooth(Shining
object)shiny surface and bounces off in a single direction, like a mirror or
a shiny water surface. This type of reflection creates a clear, sharp
reflection of the light source.
Think of it Like This:
Imagine you’re looking at a mirror. When light hits the smooth surface of
the mirror, it reflects off and you see a clear image of yourself. That’s
specular reflection. The light doesn’t spread out, it stays focused and
creates a sharp, clear reflection.

Free Notes
RRSIMT CLASSES Available
WHATSAPP on : [Link]
– 9795358008 Follow us On
Computer Graphics: Unit-5

Free Notes
RRSIMT CLASSES Available
WHATSAPP on : [Link]
– 9795358008 Follow us On
Computer Graphics: Unit-5

 Phong illumination Model –


The Phong Illumination Model is used in computer graphics to simulate
how light interacts with surfaces. It is a way to calculate how bright and
shiny a surface looks when light hits it.
The model combines three components: ambient light, diffuse reflection,
and specular reflection.
1. Ambient Light
Ambient light is the basic light that affects all surfaces equally, no matter
what direction they are facing. It's like the general light in a room. Even
without a direct light source, objects still get a little light, just because of the
environment around them.

Free Notes
RRSIMT CLASSES Available
WHATSAPP on : [Link]
– 9795358008 Follow us On
Computer Graphics: Unit-5

2. Diffuse Reflection
Diffuse reflection happens when light hits a rough surface. The light gets
scattered in all directions. This gives the object a soft, matte appearance,
like how the sunlight makes a wall look without any shiny spots.
The more light that hits a surface directly, the brighter the object appears.
3. Specular Reflection
Specular reflection is what creates shiny spots on an object. When light hits
a smooth surface (like a mirror or a shiny car), it bounces off in a specific
direction, forming a bright reflection (like a highlight or glare). The sharper
the angle between the light and the surface, the brighter the reflection will
be.

Free Notes
RRSIMT CLASSES Available
WHATSAPP on : [Link]
– 9795358008 Follow us On
Computer Graphics: Unit-5

Phong Illumination Model Formula


The Phong model combines these three types of light to calculate the final
color intensity of a surface.
Formula : I = Ia + Id + Is

Where:
•Ia is the ambient light intensity (a constant).
•Id is the diffuse reflection intensity.
•Is is the specular reflection intensity.

Free Notes
RRSIMT CLASSES Available
WHATSAPP on : [Link]
– 9795358008 Follow us On
Computer Graphics: Unit-5
Warn illumination Model –
 All the time we are using single light source in illumination
model but in warn model we are using multiple light source to
create studio lighting effect to control the intensity in different
directions.
 The Warn Illumination Model (also known as Warn Shading) is
another method used in computer graphics to simulate how light
interacts with a surface. It's an improvement over the Phong
model, specifically designed to simulate smooth, curved surfaces
more accurately.
In the Warn Model, the key idea is that lighting calculations are
done at each vertex (corner of a polygon), and then the resulting
Free Notes
RRSIMT CLASSES Available
WHATSAPP on : [Link]
– 9795358008 Follow us On
Computer Graphics: Unit-5
colors are interpolated (blended) across the surface of the polygon. This
makes it more efficient and gives a smoother appearance than the Phong
model in certain cases.

What is Intensity Attenuation?


Intensity attenuation is a way to describe how light gets weaker as it travels
farther from the light source. It explains why light doesn’t look as bright
when you are far away from it.
Think of it like this: The farther you are from a light, the dimmer it seems.
In computer graphics, when we simulate how light affects an object, we need
to consider this effect of light getting weaker as it moves away from its
source. This effect is very important for making objects look more realistic.
Free Notes Available on : [Link]
Computer Graphics: Unit-5
Color Consideration?
Color consideration in computer graphics is the process of deciding how
to represent and calculate the color of an object in a scene based on how
light interacts with it. In simple terms, it's how we figure out the color we
see on an object when light hits it.
In the real world, when light hits an object, the object reflects certain
wavelengths (colors) of light and absorbs others. This is what makes
objects look a certain color to our eyes. In computer graphics, we need to
simulate this behavior to make the objects look realistic.
How Does Light Affect Color?
Different types of light (like sunlight or artificial light) can make objects
appear in different colors. The color of an object is influenced by:
Free Notes Available on : [Link]
Computer Graphics: Unit-5

The color of the light that hits it.


How the object reflects the light (how shiny or matte it is).
The material of the object (is it red, green, blue, etc.?).

Formula - C = Ca . Cd . Cs
Where:
•C is the final color of the object.
•Cambient is the color of the ambient light.
•Cdiffuse is the color of the object’s diffuse reflection.
•Cspecular is the color of the object’s specular reflection (shine).

Free Notes Available on : [Link]


Computer Graphics: Unit-5

RGB and CMY Model –


What is RGB? The RGB color model is a way of creating colors by mixing
different amounts of three primary colors: Red (R), Green (G), and Blue (B).
This model is mostly used in devices like TVs, computer screens, cameras,
and smartphones where light is emitted to display colors.
How Does RGB Work?(0-255 Intensity value of color )
RGB stands for Red, Green, and Blue.
By changing the intensity (how much light) of each of these colors, we can
create all the other colors we see on a screen.
The colors are additive: When you mix more light, you get a brighter, more
intense color.

Free Notes Available on : [Link]


Computer Graphics: Unit-5

CMY Color Model


What is CMY? The CMY color model is a way of creating colors by mixing
three primary colors: Cyan (C), Magenta (M), and Yellow (Y). This model is
commonly used in printing and other subtractive color systems, where
colors are made by subtracting light from a white surface.
How Does CMY Work?
CMY stands for Cyan, Magenta, and Yellow.
In the CMY model, colors are created by subtracting certain colors of light.
Cyan subtracts Red, Magenta subtracts Green, and Yellow subtracts Blue.

Free Notes Available on : [Link]


Computer Graphics: Unit-5

Transparency & Shadow :


What is Transparency? Transparency refers to the ability of an object or
surface to let light pass through it. When an object is transparent, you can
see what's behind it. This is the same as how you can see through glass or
water.
How Does Transparency Work?
[Link] Transparent: If an object is completely transparent, like clear glass,
you can see everything behind it clearly.
[Link] Transparent: If an object is partially transparent, you can still
see what’s behind it, but it will be a little blurry or dimmed, like a tinted
window or frosted glass.

Free Notes Available on : [Link]


Computer Graphics: Unit-5
[Link]: If an object is opaque, you can’t see through it at all
(like a brick wall).
In computer graphics, transparency is used to make objects look realistic,
such as glass, water, or plastic.
How to Create Transparency in Graphics:
Transparency is usually controlled by a value called alpha (α). It ranges from:
Alpha = 1: Fully opaque (no transparency).
Alpha = 0: Fully transparent (completely see-through).
Alpha between 0 and 1: Partial transparency (you can see some of the
object behind it).
Example of Transparency:

Free Notes Available on : [Link]


Computer Graphics: Unit-5

Imagine you have a window. If the window is clear, you can see
through it (transparent). If the window has a tint (like sunglasses),
you can still see through it, but not as clearly (partially transparent).
If it's a solid wall, you can't see through it at all (opaque).

Free Notes Available on : [Link]


Computer Graphics: Unit-5
Shadows
What are Shadows? A shadow is the dark area created when an object
blocks light. It happens because the light can’t reach the surface behind
the object, so that part appears darker.
How Do Shadows Work?
•Shadows are created by light sources: When light hits an object, it blocks
the light from passing through, creating a shadow.
•The position of the light source affects the shadow: If the light source is
closer to the object, the shadow will be larger. If the light is far away, the
shadow will be smaller.
•The shape of the shadow depends on the object’s shape: If you block
light with a sphere, the shadow will be circular. If you block light with a
cube, the shadow will be more square-shaped.
Computer Graphics: Unit-5

How Shadows are Used in Graphics:


In computer graphics, shadows make objects look more realistic by showing
depth and position. Without shadows, objects might look like they’re
floating or not touching the ground.
There are two types of shadows:
[Link] Shadows: Sharp and well-defined edges, like when the light source is
small and close to the object (e.g., the shadow of a tree on a sunny day).
[Link] Shadows: Blurry edges, like when the light source is big or far away
(e.g., shadows cast by clouds).
Example of Shadows:
•Think about a lamp in a dark room. The lamp creates a shadow on the wall

Free Notes Available on : [Link]


Computer Graphics: Unit-5

Soft Shadow

Transparency
You can see

Free Notes Available on : [Link]


Thank You…

Best of Luck for your Exam.


Free Notes Available on : [Link]

You might also like