0% found this document useful (0 votes)
8 views86 pages

CG Dse

Uploaded by

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

CG Dse

Uploaded by

Sujata Chaskar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 86

Unit III : 2D, 3D Tranformation

and Projection.
2D Tranformation:
 2D Tranformation:

 Repositioning and Resizing of an object is called as tranformation


 Types of Tranformation:
o Translation
o Rotation
o Scaling
 Homogenious Co-odinates
 Other Tranformation:
o shearing
o Reflection

 Translation:

 Translation is repositioning of an object in a straight line.


 Derivation:
o
 Example Numberical:
o
 Rotation:

 Repositioning of an object in a circular path is called as Rotation.


 Derivation:
o
o Matrix Representation:
o

 If Anticlockwise, Rotation angle +ve


 If Clockwise, Rotation angle -ve

 Scaling:

 Zoom-In or Zoom-out of object is called as scaling


 Scaling Factor:
o scaling in x-direction : Sx
o scaling in y-direction : Sy
 Equation:
o

 Conditions:
o

 Homogenious Co-ordinates:
 It derives the general matrix equation that covers all the equations
by translation, rotation and scaling.
 General Equation:
o

 HOmogeneous Co-ordinates (Row Major):


o

 Rotation About Arbitrary point:


 Translate arbitrary point to origin.
 Rotate at θ angle
 Translate back at same arbitrary position.

 Final Equation:
o

 Shear:
 Slanting or tilting something is called as shear
 types:
o X - shear : Only X co-ordinate change, y is preserved
o Y - shear : Only y co-ordinate change, X is preserved
 X - Shear Equation:
o

 Y - Shear Equation:
o

 Shearing relative to other reference line:


o

3D Tranformation:
 3D

 Dimension: defining a object in a physical spatial with minimum no.


of co-ordinate is called as Dimension.
 The number of ways in which we can move in a dimension is defined
as no. of dimension.
o 0D : We cannot move at all
o 1D : We can move in only one direction
o 2D : We can move in two directions
o 3D : We can move in all directions (3)

 3D Translation:

 Equation:
o
 3D Scaling:

 Equation:
o
 3D Rotation parallel to co-ordinate axis:

 Equation z-axis:
o

 Equation all axis:


o
Projections:
 Projections:

 Projection is the process of tranforming an object representation


from n-dimensional space to less than n-dimensional space.
 projection is the process of creating image on 2D plane.
 View Plane or Projectin Plane: Plane where object is projected.
 Types:
o Parallel Projection
o Perspective Projection
o

 Taxonomy of Projection:
o

 Rays of line is called as projector.


 Parallel Projection:

 Parallel projection is achieved by passing parallel rays from the


object vertices and projecting the object on view plane.
 All projection vectors are parallel to each other.
 It preserves true shape and size of the object on view plane.
 It fails to capture depth information and hence cannot produce a
realistic view.
 Types:
o Orthographic Parallel projection
o Oblique parallel projection
o
o

 Orthographic Projection:

 Ortho means at Right angle.


 If projectors are perpendicular to view plane, then it is called as
orthographic projection.
 Types:
o Multiview: Top view, side view, bottom view, i.e we can
generate multiple type of view but they can be seen in
2Dimensional view.
o Auxinomatrix: Here we can see in all 3 dimensions
 Isometric = All angle equal -
 Dimetric = Two angles are not equal
-
 Trimetric = Three angles are not equal. -
 Oblique parallel Projection:

 Projectors are parallel to each other but not perpendicular to view


plane.
 Types:
o Cavalier
 Keep bigger face of object
 Strike rays at any angle
 The length of image with wide length will be same and
other edge length will be proportional.
o Cabinet:
 Cabinet says if the angle is 63.40 then the wide length
will look 1/2.

 Perspective Projection:

 Lines of projection i.e projectors will intersect and we can see the
lines meeting at one point, this point i s called as center of
projection/ projection reference point.
 It will give us realistic views.
 Vanishing point: Like railway track, the parallell line seems meeting
at infinity, such point is called as vanishing point.
 Vanishing point types:
o 1 point : if 1 vanishing point is created then called as 1 point.
o 2 point : if 2 vanishing point is created then called as 2 point.
o 3 point : if 3 vanishing point is created then called as 3 point.

P.S. Done Unit III - 2D, 3D Transformation and Projection.

Unit IV - Light, Colour, Shading


and Hidden Surfaces
Syllabus:
 Colour modes:
o Properties of Light
o CIE chromaticity Diagram
o RGB
o HSV
o CMY
 Illumination Models:
o Ambient Light
o Diffuse reflection
o Specular Reflection
o and the Phong model
o Combined diffuse and Specular reflections with multiple light
sources
o warn model
 Shading Algorithms:
o Halftone
o Gauraud
o Phong Shading
 Hidden Surfaces:
o Introduction
o Back face detection and removal
o Algorithms:
 Depth Buffer (z)
 Depth sorts(Painter)
 Area Subdivision(Warnock)

Colour Models:
 Properties of Light:

 Light is an electromagnetic wave.


 Rays having a wavelength between 400nm to 750 nm are visible.
 Light interacts with the material in four different ways.
o Emission - An object can emit the Light
o Absorption - An object can absorb the light
o Reflection - The light might bounce off the object
o Refraction/Transmission - Light might pass through the object.
 Color of object depends on a mixture of reflected frequency from
the surface of the object. If the surface reflects lower frequency
then object appears reddish. This dominant lower frequency decides
the color and ultimately hue of the color.
 How pure color should appear is decided by the saturation.
 How bright the scene should appear is decided by the brightness.
 Purity is proportional to saturation. When hue and saturation are
collectively used to describe the color, it is called chromaticity.
 Combination pairs of colors that produce neutral color like white in
return is called as complementary colors.
o Ex.
o Red and Cyan
o Green and Magenta
o Blue and Yellow
 Color gamut is the set of all the visible colors to the human eye.
 In computer system, red, green and blue colors are combined with
various intensity to produce all the colors.
 System supporting 24 bit per pixel can produce 17 million different
colors using three basic colors red, green and blue.

 CIE Chromaticity Diagram:

 Chromaticity diagram represents all the possible color that the


human eye can perceive.

 Color Models:

 Color model is a system to create a wide range of colors from small


set of primary colors.
 There are two types of Color modes:
o Additive
o Subtractive

 RGB Color Model:

 It is an additive color model.


 It adds red, green and blue to produce a wide range of colors.
 Not suitable for image processing applications.
 It is a device dependent color model.
 Different devices reproduce the same RGB value differently.
 We can define this color model as a unit cube with R, G, B as its
three axes.
 Zero intensity of all three component produce black color and full
intensity of them produce the white color.
 An equal proportion of all three colors between zero to one produce
grey shade (diagonal line joining origin and opposite cube corner.)

 When anyone component has a dominant intensity, the color is a


hue of primary color, and when two components have the same
dominant intensity, then the color is a hue of a secondary color. A
secondary color is formed by the sum of two primary colors of equal
intensity.
 When primary and its complementary secondary color are added
together, the result is white.
o ex. the complement of red is cyan, the complement of green
is magenta and the complement of green is yellow.
 RGB is an additive color model and any color C can be obtained by
addition of R, G and B.
o C = RR + GG + BB

 HSV Color Model:

 H, S and V stand for Hue, Saturation and Value, repectively.


 Hue defines the color
 Saturation defines the purity of color
 Value defines the intensity.
 RGB and CMY are defined over cubic space
 HSV is defined over hexagon or cone shape.

 CMY color model:

 CMY color model is subtractive color model.


 C - Cyan, M - Magenta, Y - Yellow

 Difference between RGB and HSV color model:



Illumination Model:
 Illumination Model:

 Lighting models that are used to calculate intensity at every pixel in


the scene is also known as Illumination model.
 Light Source:
o Light emitting source
o Surface that reflects light can also act as light source.

 Ambient Light:

 Even if the object is not directly exposed to the light source, due to
reflected rays from the other surfaces, it would be still visible. Such
light is called as ambient light.
 Ambient light is constant for all the surfaces and it scatters equally
in all direction.
 Objects illuminated using ambient Illumination model appears as a
monochromatic, silhouette, unless the polygon facets of objects are
given different shades.
 If we assume that the ambient light reflected from all surfaces are
the same and in all directions, then the illumination model equation
would be,
o

 Diffuse and Specular Reflection

 Diffuse Reflection:
o Equal reflection of light in all direction from surface is called
as diffuse reflection.

 Specular Reflection:
o Reflection in a particular direction only is know as specular
reflection.
o

 Ideal diffuse Reflector or Lambertian reflectors:


o If diffuse reflection scattered from the surface is equal in all
direction, independent of viewing directions, such surfaces are
called ideal diffuse reflector or Lambertian reflectors, since the
radiated light energy from any surface is governed by
Lambert's cosine law.

 Specular Reflection and Phong Model:

 Specular Reflection:
o Reflection in a particular direction only is know as specular
reflection.
o

 Combined Diffuse and Specular Reflections with Multiple Light


Sources:

 Warn Model:

 Warn model provides a way to model the studio light with varying
intensity in different directions.

Shading Algorithms:
 Gauraud Shading:

 Flat shading/Constant intensity shading:


o We get discontinuity in flat shading so we use gauraud
shading.
 Steps:
o Determine the average unit normal vector at each polygon
vertex.
o Apply illumination model to each polygon vertex to determine
polygon vertex intensity.
o Linearly interpolate the vertex intensities over the surface of
polygon.

 Phong Shading/Normal Vector interpolation shading:

 Steps:
o Determine the average unit normal vector at each polygon
vertex.
o Linearly interpolate the vertex normals over the surface of
polygon.
o Apply the illumination model along each scan to determine
projected pixel intensities of surface points.

 Halftone Shading:

 Halftoning is used on a device supporting a limited intensity range.


 Halftoning improves the quality of the picture by increasing visual
resolution using a minimum number of intensity levels. This method
is also known as patterning.
 Halftoning is used to reproduce the photographs for newspapers
and magazines. This process is called halftoning and the reproduced
image is called halftoning.
 Halftone image looks like as if it is composed of black circles of
different radius. The dark region is produced using large circles.
Light regions are produced by small circles. Good qualitiy books and
mazine are printed using approximately 60-80 circles of varying
radius per centimetre.
 Example:
o

 Difference between gourauld and phong shading:



Hidden Surfaces:
 Hidden Surfaces:

 Visible surface detection algorithms are also known as hidden line or


hidden surface removal algorithms.
 Aim of such algorithms is to identify the visible lines or surfaces of a
given set of object from particular viewing direction.

 Back Face Detection and Removal:

 Sometimes visible surface detection is also referred to as hidden


surface removal of back face detection.




 Depth Buffer:

 Depth Buffer method is also known as the z buffer method.


 This is an image space approach.
 It compares the depth of the pixels of overlapping objects into the
scene and renders the nearest pixel to the viewer.
 This algorithm is generally applied on normalized co-ordinates,
where all values fall between 0 and 1.
 This algorithm is an extension of the idea of the frame buffer.
Implementation requieres two buffers.

 P.S. Refer to Book for Depth Buffer algo + depth sort + Warnock
 Done Unit IV - Light, Colour, Shading and Hidden surfaces.

Unit V - Curves and Fractals


✧ Syllabus:
 Curves:
o Introduction
o Interpolation and Approximation
o Blending Function
o B-Spline Curve
o Bezier Curve
 Fractals:
o Introduction
o Classification
o Fractal Generation:
 Snowflake
 Triadic Curve
 Hilbert curve
 Applications

✧ Curves:
 Introduction:

 Whatever you draw continuously without lifting up pen is called as


curve.
 i.e set of points joined continuously is called as curve.
 Representation:
o Explicit
o Implicit
o Parametric form

 Interpolation and Approximation:

 Curve is specified by a set of control points.


 Interpolation:
o If the curve passes through the control points, it is called
interpolation.
o Interpolation curves are used in animation and specifying
camera motion. It is also used in digitizing the coordinates
 Extrapolation/Approximation:
o If the curve does not pass through the control points and
approximate the shape, it is called Approximation or
Extrapolation.
o Such curvevs are used to estimate the shape of the object
surface.
 Example:
 Convex Hull:
o The curve is satisfying convex hull property if the entire curve
lies within the convex hull.
o

o Clipping the curve satisfying convex hull property is easy.


o Trivial acceptance and rejection conditions are easy to
evaluate for them.
o If bounding box of the convex hull is inside Clipping region, no
need to clip the curve. And if a bounding box is completely
outside clipping window, clip the entire curve.

 Blending Function:
 Bezier Curve:

 This is an approximate spine curve.


 With cubic polynomials, Bezier curve can approximate any number
of control points.
 In Bezier curve, the degree of polynomial depends on a number of
control points used to generate curve segment.
 In Bezier curve, the degree of the polynomial is always one less than
a number of control
points.

 With n + 1 control points,parametric equation of Bezier curve


approximating points p0 to pn,

o

 Properties of Bezier Curves:


o Degree of the curve is one less than a number of control
points
o Always interpolates first and last control points and
approximates remaining two.
o The slope of the derivative at the beginning is along the line
joining the first two points and slope of the derivative at the
end is along the line joining last two points.
o Bezier curve always satisfies the convex hull property.
o At any parameter value t, sum all four Bezier blending
function is always 1, i.e,


o Polynomial Smoothly follows the control points without much
oscillation.
o Bezier curves do not have local control; repositioning one
control point changes the entire curve.
o The curve is invariant under affine trnaformation.
o The basis functions are real.
o The curve exhibits variation diminishing property, i.e. any line
intersects the Bezier curve at most as often as that line
intersects the polygon interpolating control points.
o Bezier curve can fit any number of control points.
o Reversing the order of control points yield the same Bezier
curve.
 Applications of Bezier Curve:
o

 Cubic Bezier Curves:


o Cubic Bezier curves are bridge between computation cost and
smoothness.
o They are very flexible and estimate shape nicely.
o We should specify four control points to generate a cubic
Bezier curve.
o Blending functions for cubic Bezier curve is derived by putting
n = 3 in the equation of Bezier curve,

o
o

o Matrix Representation:

o Limitation of Bezier curve:


o Subdivision Method:

 B-Spline Curve:






 Bezier VS B-Spline Curve:
✧ Fractals:
 Fractals:

 Fractals are infinitely complex patterns that are self similar across
different scales.
 Properties:
o Infinite detail at every point.
o Self-similarity between object parts.
o Natural objects have infinite details; however, we should
design a process which produces finite detail because on the
computer we cannot display infinite detail.
o After certain levels of zoom in, Euclidean shapes lead to
smooth drawing. While in the fractal object, if we keep zoom
in, we continue to see the same detail as it appears in the
original object.
o

o Zoom in effect on the monitor is achieved by selecting a


smaller and smaller window with the same viewport. Less and
less detail is mapped to the same size as the viewport.
 Classification:

 Self-similar fractals:
o Such fractal exhibits the self-similarity in shape.
o We can construct the object by applying different scaling
factors to all parts or by using the same scaling factor for all.
o If we use a random scaling factor to generate the subparts, a
fractal is called statistically self-similar.
o statistically self similar fractals are used to construct shapes
like tree, shrubs, plants etc.
 Self-affine fractals:
o Such fractals use different scaling factors for all three
directions. We can add random variation to get statistically
self-affine fractals. This class of fractals is best suited to model
terrain, water, clouds etc.
 Invariant fractals:
o Nonlinear transformation is applied to construct such fractals.
A self-squaring function in complex space produces self-
squaring fractals like Mandelbro. Self-inverse fractals are
generated using the inversion procedure.

 Fractal generation:
 Application:

 Fractals are used to model the natural shapes. Some of the


prominent application areas of fractals are listed here:
o Modelling natural structures like Geographic terrain,
mountain, plant structure, clouds, vegetables, etc.
o study of the chaotic phenomenon.
o Fractal art
o Space research
o Study of convergence of iterative processes
o Engineering and architecture.
o Medical science.
o Chemical processes.
o Medical diagnostic images.
o Fluid mechanics
o Image compression
o Telecommunication

P.S. Done Unit V - Curves and Fractals.

Unit VI - Introduction to
Animation and Gaming
✧ Syllabus:
 Segment:
o Introduction
o Segment Table
o Segment Creation
o Closing
o Deleting and renaming
o Visibility.
 Animation:
o Introduction
o conventional and computer based animation
o Design of animation sequences
o Animation languages
o Key-frame
o Morphing
o Motion specification
 Gaming:
o Introduction
o Gaming platform(NVIDIA, i8060)
o Advances in gaming

✧ Segment:
 Segment:

 The image is divided into small substructures called segments.


 These segments are managed using segment table.
 i.e. Part of the display file is called as a segment.
 Attributes like Visibility and image transformation are set for each
segment.
 Set Visibility attribute to ON, if we want to display the object, set it
OFF otherwise.
 To perform thee geometric transformation on the object, enable
image transformation attribute and set appropriate parameters.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy