0% found this document useful (0 votes)
98 views47 pages

CG Unit - 5

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

CG Unit - 5

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

UNIT- V

Curve :

In computer graphics, we often need to draw different types of objects onto the screen.
Objects are not flat all time and we need to draw curves many times to draw an object.
Types of Curves:
The curve is an infinitely large set of points. Each point has two neighbours except
endpoints.
1. Implicit curves
2. Explicit curves
3. Parametric curves
4. Bezier curves
5. B-spline curves
Curve :

Implicit Curves:
An implicit curve or surface is the set of zeros of a
function of 2 or 3 variables. We use implicit curve
functions to define lines and planes. Provides no control
over tangents at connection points when joining several
implicit functions. Implicit functions are hard to find for
many shapes. Use a function that states which points are
on and off the curves.

All lines: Ax+By+C=0


Curve :

Explicit curves:
• Do not allow for multiple values for a given argument
• Cannot describe vertical tangents, as infinite slopes are hard to represent.
• Cannot represent all curves (vertical lines, circles)

Mathematical function:

f = y(x) can be plotted on curve


eg: y = 2X^5+3X^4

y=mx+c
Curve :

Parametric curves:
Curves have a parametric form called parametric curves. A curve in the plane is said
to be parameterized if the set of coordinates on the curves (x,y,z) is represented as a
function of a variable t. The variable t is called a parameter and the relations between
x,y,z, and t are called a parametric equation
Curve :

Parametric curves:
The parametric form of a curve is a function that assigns a position to values of the
free parameters. That the parametric function is a vector-valued function. This
example is a 2D curve, so the output of the function is a 2-D vector, in 3D it would be
a 3 vector. It is simple and flexible.
Curve :

Parametric curves:
The parametric form is suitable for representing closed and multivalued curves. In
parametric curves, each coordinate of a point on a curve is represented as a function
of a single parameter. There are many curves that we cannot write down as a single
equation in terms of x and y. The position vector of a point on the curve is fixed by
the value of the parameter. Since a point on a parametric curve is specified by a
single value of the parameter, the parametric form is axis-dependent. The function of
each coordinate can be defined independently
Curve :

Bezier Curve
A bezier curve is particularly a kind of spline generated from a set of control points
by forming a set of polynomial functions. Discovered by the french engineer Pierre
bezier. These functions are computed from the coordinates of the control points.
These curves can be generated under the control of other points. Tangents by using
control points are used to generate curves.
It is an approximate spline curve. A bezier curve is defined by the defining polygon.
It has no properties that make them highly useful and convenient for curve and
surface design.
Curve :

Bezier Curve
Different types of curves are Simple, Quadratic, and Cubic.
Simple curve: Simple bezier curve is a straight line from the point.
Curve :

Bezier Curve
Different types of curves are Simple, Quadratic, and Cubic.
Quadratic curve: Quadratic bezier curve is determined by three control points.
Curve :

Bezier Curve
Different types of curves are Simple, Quadratic, and Cubic.
Cubic curve: The cubic bezier curve is determined by four control points.
Curve :

Properties of Bezier Curve:


• Bezier curves are widely available and used in various CAD systems, in general
graphics packages such as GL
• The slope at beginning of the curve is along the line joining the first two control
points and the slope at the end of the curve is along the line joining the last two
points
• Bezier curve always passes through the first and last points i.e p(o)=po,
p(1,=pnlie)
Curve :

Properties of Bezier Curve:


• The curves lies entirely within the convex hall formed by the four control points
• The slope at the beginning of the curve is along the line joining the first two
control points and the slope at the end of the curve is along the line joining the
last two points.
• The degree of polynomial defining the curve segment is one less than the no of
defining the polygon.
Bezier Curve for 3 Points:
Q(u)=PoBo12(u)+P1B1,2(u)+P2B2,2(u)
B0,2(u)=2Co*+u^0(1-u)*^2-0 = (1-U)^2
B1,2(u)=2C1*U^1(1-u)*^2-1 = 2u(1-u)
B2,2(u)=2C2*U^2(1-u)*^2-2 =u^2

Q(u)=P0(1-u)^2+P1*2u(1-u)+P2U^2
X(u)=(1-u)^2*X0+2U*(1-u)*X1+u^2*x2
Y(u)=(1-u)^2*y0+2u*(1-u)*y1
Bezier curves exhibit global control points means moving control points alert the shape of
the whole curve.
Koch Curve or Koch Snowflake :

The Koch snowflake (also known as the Koch curve, Koch star, or Koch island) is a
mathematical curve and one of the earliest fractal curves to have been described. It is based
on the Koch curve, which appeared in a 1904 paper titled “On a continuous curve without
tangents, constructible from elementary geometry” by the Swedish mathematician Helge
von Koch.
The progression for the area of the snowflake converges to 8/5 times the area of the original
triangle, while the progression for the snowflake’s perimeter diverges to infinity.
Consequently, the snowflake has a finite area bounded by an infinitely long line.
Koch Curve or Koch Snowflake :

Construction
Step1:
Draw an equilateral triangle. You can draw it with
a compass or protractor, or just eyeball it if you
don’t want to spend too much time drawing the
snowflake.
It’s best if the length of the sides are divisible by 3,
because of the nature of this fractal. This will
become clear in the next few steps.
Koch Curve or Koch Snowflake :

Construction
Step 2:
Divide each side in three equal parts. This is why it
is handy to have the sides divisible by three.
Koch Curve or Koch Snowflake :

Construction
Step 3:
Draw an equilateral triangle on each middle part.
Measure the length of the middle third to know the
length of the sides of these new triangles.
Koch Curve or Koch Snowflake :

Construction
Step 4:
Divide each outer side into thirds. You can see the
2nd generation of triangles covers a bit of the first.
These three line segments shouldn’t be parted in
three.
Koch Curve or Koch Snowflake :

Construction
Step 5:
Divide each outer side into thirds. You can see the
2nd generation of triangles covers a bit of the first.
These three line segments shouldn’t be parted in
three.
Koch Curve or Koch Snowflake :

The Koch curve can be expressed by the following


Alphabet: F
Constants: +, ?
Axiom: F
Production rules: F? F+F–F+F
Here, F means “draw forward”, – means “turn right 60°”, and + means “turn left 60°”.
To create the Koch snowflake, one would use F++F++F (an equilateral triangle) as the
axiom.
Koch Curve or Koch Snowflake :
Fractals :

Fractals is a complex picture created using


iteration and a single formula. Sometimes,
objects cannot be drawn with a given
equation or with a given geometry.
Examples: mountains, clouds. Their shape
cannot be defined so in this case, we use
fractals. So these are nothing but natural
objects that can be drawn with the help of
fractals. Below is an example of a fractal
diagram.
Fractals :

Basically, Fractals are used in many areas for its importance such as −

Astronomy: for the analysis purpose of Saturn’s rings, galaxies, etc.


Biology/Chemistry: For the purpose of illustrating chemical reactions, human anatomy,
molecules, plants, and bacterial cultures.

Others: For the purpose of representing the required clouds, borders, the coast, data
compression, diffusion, economy, fractal music, fractal art, landscapes, special effects, and
so forth.
Fractals :

Generation of Fractals
So, repeating the same shape repeatedly can result in fractals. To get the appropriate shape
and size, we can iterate indefinitely. Recursion is the computer language term for making
such forms as per requirement.
Fractals :

Types of Fractal
There are three types of fractals:

Self-similar: These fractals have parts as a scaled-down version of the entire object. So if
we scale up from a smaller part of the fractal, we will scale up to the whole object.

Self Affine: It has parts formed with different scaling parameters in different coordinate
directions. For example in the direction, the scaling may be different from that t of y-
direction. So the fractal will not be exactly similar in all directions.

Invariant: Formed with nonlinear transformations. The smaller and bigger objects in the
fractal are different.
Fractals :

Fractal Dimension
• Fractal is a measure of roughness or fragmentation of an object.
• More fractal dimensions in case of more jagged-looking objects.
• Using some iterative procedure, we can calculate fractal dimension D.
Basics of Animation :
• Generally, Computer animation is a visual digital display technology that processes the
moving images on screen.
• In simple words, it can be put or defined as the art or power of giving life, energy and
emotions etc. to any non-living or inanimate object via computers.
• It can be presented in form of any video or movie. Computer animation has the ability to
make any dead image alive.
• The key/main concept behind computer animation is to play the defined images at a
faster rate to fool the viewer so that the viewer should interpret those images as a
continuous motion of images.
Basics of Animation :

• Computer Animation is a sub-part or say small part of computer graphics and animation.
Nowadays, animation can be seen in many area around us.
• It is used in a lot of movies, films and games, education, e-commerce, computer art,
training etc.
• It is a big part of entertainment area as most of the sets and background is all build up
through VFX and animation.
Basics of Animation :

Definition of Animation :
Animation is the process of creating an illusion of motion and shape change by means of
rapid display of various type of pictures that were made to create a single scene.
Principles of Animation :
• Before doing animation, every animator should follow these principles to create a good
animation.
• These principles was evolved from past animation techniques but these principle are
also very useful and essential for doing animation.
• In 1981 two bright Disney animators Ollie Johnston and Frank Thomas introduced
twelve basic principles of animation to produce more realistic works.
• These principle are also applicable on present computer animations.
There are 12 basic principles of animation, they are-
• Squash and Stretch – This is the most important principle of animation, it gives
the sense of weight and volume to draw an object.

• Anticipation – In this principle animator will create a starting scene like that it
shows that something will happen, almost nothing happens suddenly.

• Staging – Animator creates such type of scene which attract audience so that
audience’s attention is directed toward that scene.

• Straight Ahead – In this principle, all frames are drawn from beginning to the end
and then fill all the interval or scene.
• Flow through and overlapping action – Two object’s action have different
speed in any scene can easily describe this principle.

• Slow in and Slow out – When an abject have maximum acceleration in between
and resist on the beginning and end will show this principle’s working.

• Arc – Arcs are present in almost all animation as no object will follow straight line
and follows some arc in its action.

• Secondary action – As with one character’s action second character move shows
the multiple dimension of an animation.

• Timing – For playing a given action a perfect timing is very important.


• Exaggeration – This principle creates extra reality in the scene by developing a
proper animation style.

• Solid drawing – In this principle, any object will created into 3D form to get
realistic visualization of scene.

• Appeal – Any character need not be as same as any real character but it somewhat
seems to be like that which create a proper thinking in the audience’s mind.
Applications of Computer Animation:
Methods/Techniques :

Frame by Frame (Traditional Method): Earlier, in traditional method,


animation was done by hands because of the absence of the computer-aided drawing
facilities. And, these traditional method required a lot of effort for even making a short
video because of the fact that every second of animation requires 24 frames to process.

Procedural: In Procedural method, set of rules are used to animate the objects.
Animator defines or specify the initial rules and procedure to process and later runs
simulations. Many of the times rules or procedure are based on real world.s physical
rule which are shown by mathematical equations.
Methods/Techniques :

Behavioural: According to this method/technique, to a certain extent the character


or object specifies/determines it’s own actions which helps / allows the character to
improve later, and in turn, it frees the animator in determining each and every details
of the character’s motion.
Methods/Techniques :

Key Framing: A key frame in computer animation is a frame where we define


changes in an animation. According to key framing, a storyboard requirement is must
as the animator/artist draws the major frames (frames in which major/important
changes can be made later) of animation from it. In key framing, character’s or
object’s key position are the must and need to be defined by the animator, because the
missing frames are filled in those key position via computer automatically.
Methods/Techniques :

Motion Capture: This method of animation uses the live action/motion footage of
a living human character which is recorded to the computer via video cameras and
markers and later, that action or motion is used/applied to animate the character which
gives the real feel to the viewers as if the real human character has been animated.
Motion Capture is quite famous among the animators because of the fact that the
human action or motion can be captured with relative ease.
Methods/Techniques :

Dynamics: In this method, simulations are used in order to produce a quite different
sequence while maintaining the physical reality. Physics’s laws are used in simulations
to create the motion of pictures/characters. High level of interactivity can be achieved
in this method, via the use of real-time simulations, where a real person performs the
action or motions of a simulated character.
Animation Functions :

Morphing: Morphing is an
animation function which is used to
transform object shape from one form
to another is called Morphing. It is
one of the most complicated
transformations. This function is
commonly used in movies, cartoons,
advertisement, and computer games.
Morphing:
The process of Morphing involves three steps:
1. In the first step, one initial image and other final image are added to morphing
application as shown in fig: Ist & 4th object consider as key frames.
2. The second step involves the selection of key points on both the images for a smooth
transition between two images as shown in 2nd object.
3. In the third step, the key point of the first image transforms to a corresponding key point
of the second image as shown in 3rd object of the figure.
Morphing:
Wrapping :

Wrapping function is similar to morphing function. It distorts only the initial images so that
it matches with final images and no fade occurs in this function.

Example: If you have an image of a rectangle, and you want to rotate it by 45 degrees.
You would create a rotation matrix, apply it to the image, and obtain its rotated version.
This is an example of simple warping.
Tweening:

Tweening is the short form of


'inbetweening.' Tweening is
the process of generating
intermediate frames between
the initial & last final images.
This function is popular in the
film industry.
Panning :

Usually Panning refers to rotation of the camera in horizontal Plane. In computer graphics,
Panning relates to the movement of fixed size window across the window object in a
scene. In which direction the fixed sized window moves, the object appears to move in the
opposite direction as shown in fig:
If the window moves in a backward direction,
then the object appear to move in the forward
direction and the window moves in forward
direction then the object appear to move in a
backward direction.
Zooming :
In zooming, the window is fixed an object and change its size, the object also appear to
change in size. When the window is made smaller about a fixed centre, the object comes
inside the window appear more enlarged. This feature is known as Zooming In.

When we increase the size of the window about


the fixed centre, the object comes inside the
window appear small. This feature is known
as Zooming Out.

You might also like