Download as pdf or txt
Download as pdf or txt
You are on page 1of 40

Fractals in Computer Graphics

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.

A fractal is a complex geometric pattern created through mathematical equations


and algorithms, exhibiting self-similarity with smaller copies at different scales.

Iterative algorithms are used to generate fractals by repeatedly applying


mathematical formulas to a basic geometric shape or pattern, resulting in more
intricate and detailed versions of the original shape.

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.

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.

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.

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.

Koch Curve

In the Koch curve, initially, you have to take a triangle, and in that triangle, each
straight line is replaced with four equal-sized lines of scaling factor 1/3.

This Koch curve is also known as the snowflake pattern.


Step 1: Below is the diagram explaining how to draw the Koch curve. We have
to first divide each side of the triangle into three equal parts and the middle part is
again divided to 1/3rd of its original length. This process will be repeated.

Step 2: After n iterations, we will get a Koch curve that will look like this.
In the Koch curve, the fractal dimension is 1.2619. This value is calculated using
the following procedure:

At each iteration, the scaling factor S is 1/3 because each line segment is divided
into 1/3 of its original length, and N is 4 because each line segment is replaced by
four smaller line segments.
Therefore, we can calculate the fractal dimension of the Koch curve as follows:

D = log(4) / log(1 / 3)
D ≈ 1.2619
Peano Curves

In computer graphics, the Peano curve, also known as the Hilbert-Peano curve, is
a type of space-filling curve named after Italian mathematician Giuseppe Peano.
It is constructed by recursively dividing a square into smaller squares and then
connecting the corners of those squares in a specific order.

The Peano curve has several interesting properties that make it useful in computer
graphics:

1. Space-filling: The curve passes through every point in the square, effectively
filling the entire space. This property is useful for generating fractals and for
tasks such as texture mapping and data compression.

2. Local coherence: Points that are close to each other in the curve are also close
to each other in the square. This property is beneficial for tasks like ray tracing
and spatial indexing.
3. Self-similarity: The curve exhibits self-similarity at different scales, meaning
that smaller portions of the curve resemble the whole curve. This property can be
exploited for generating complex patterns and for achieving level-of-detail
effects.

4. Easy to generate: The Peano curve can be generated using simple recursive
algorithms, making it computationally efficient to construct and manipulate.

Applications:

i). In computer graphics, the Peano curve is often used in techniques such as
space-filling curves for

data indexing,

fractal generation, and

texture mapping.

ii). It's particularly useful in applications where continuous space needs to be


discretized or where efficient traversal of space is required, such as in image
compression algorithms or in generating realistic terrains.

Creating Images by iterated Functions (iterated Function Systems)

Iterated Function Systems (IFS) are a powerful mathematical framework used in


computer graphics for generating fractals and complex geometric structures. An
Iterated Function System consists of a set of functions, each of which describes a
transformation applied to points in a space, and a set of probabilities associated
with each function. These transformations are typically affine transformations
(linear transformations followed by translations).
In computer graphics, IFS is often used to generate fractals, which are self-similar
geometric shapes that exhibit repeating patterns at different scales.

An initial image is transformed to produce new image and that image is again
transformed to another image. This can be shown by the following diagram:

This process involves copying transformed images repeatedly. Each image is


generated by texture mapping and blending copies of the previous images like the
image below:
Here's how IFS works in the context of computer graphics:

1. Initialization: Start with a set of initial points in the space, often a simple shape
like a point, line, or square.

2. Iterative Transformation: Apply the set of transformations defined by the IFS


to each point repeatedly. At each iteration, randomly select one of the
transformations based on their associated probabilities and apply it to each point.

3. Visualization: As the iterations progress, the points move according to the


transformations, eventually forming a complex pattern or fractal structure. This
pattern can be visualized by plotting the points or by rendering them as pixels on
a screen.

4. Coloring and Rendering: Once the fractal is generated, it can be colored and
rendered to create visually appealing images. Different coloring techniques, such
as assigning colors based on the point's position or density, can be used to
enhance the visual appearance of the fractal.

IFS has numerous applications in computer graphics, including:

- Fractal Generation: IFS can be used to generate a wide variety of fractals,


including the famous Barnsley fern and Sierpinski triangle.

- Texture Synthesis: IFS can be used to synthesize textures with complex patterns
that exhibit self-similarity, such as wood grain or marble.

- Terrain Generation: IFS techniques can be applied to generate realistic terrain


heightmaps by iteratively refining initial elevation points based on certain rules
and transformations.

- Procedural Modeling: IFS can be used in procedural modeling to generate


complex geometric structures such as trees, foliage, or architectural details.

An Iterated Function Systems provide a flexible and efficient framework for


generating complex and visually appealing geometric structures in computer
graphics.
Mandelbrot Sets:

This is popular for generating visually stunning fractalimages. It is a set of


mathematical set of complex numbers defined by iterative algorithm. Starting
with a number ‘C’ the sequence will be Z n+1 = Zn2 + C.

Visualising Mandelbrot Sets:

One approach to visualize Mandelbrot set is Escape Time Rendering and the
algorithm is as follows:

Algorithm:

Step 1: Choose a complex number ‘C’ from the plane.

Step 2; Set an initial value for Z 0= 0.

Step 3: Iterate the formula Zn+1 = Zn2+C for predetermined number of


iterations.

Step 4: If |Zn| ≤ R( where R-> predetermined threshold) then point C is part of


mandelbrot set.

Step 5: If |Zn| > R( where R-> predetermined threshold) then point C is not part
of mandelbrot set.

Step 6: Repeat the steps 1 to 5 for each and every point in the plane to generate
the Mandelbrot sets.

Julia Sets:

Julia sets are another fascinating aspect of fractal geometry, closely related to
Mandelbrot sets. They are named after the French mathematician Gaston Julia,
who studied them in the early 20th century. Julia sets are generated by iterating a
complex function on complex numbers.
To visualize Julia sets, here's a step-by-step process:

1. Choose a Complex Function: Unlike the Mandelbrot set, which uses the
function \( f(z) = z^2 + c \), Julia sets use a fixed complex function \( f(z) \).
Common choices include quadratic polynomials, such as \( f(z) = z^2 + c \),
where \( c \) is a complex constant.

2. Initialize Parameters:

- Define the dimensions of the image (width and height).

- Define the range of complex numbers to explore in the complex plane (xmin,
xmax, ymin, ymax).

- Set the maximum number of iterations for determining set membership.

- Choose a complex constant \( c \) for the chosen function \( f(z) \).

3. Iterate Over Pixels:

- Iterate over each pixel in the image grid.

4. Map Pixel Coordinates to Complex Plane:

- For each pixel (x, y), map its coordinates to a complex number \( z \) in the
specified range in the complex plane.

5. Iterate the Complex Function:


- For each complex number \( z \), iterate the chosen complex function \( f(z) \),
starting with the initial value of \( z \), for a maximum number of iterations or
until the magnitude of \( z \) exceeds a threshold.

6. Determine Set Membership:

- Similar to the Mandelbrot set, determine whether the iterated sequence


remains bounded within a certain threshold. Points that remain bounded are
considered part of the Julia set, while points that diverge are not.

7. Assign Colors:

- Assign colors to the pixels based on set membership or divergence behavior.


You can use various coloring schemes, such as assigning colors based on the
number of iterations required for divergence or based on the behavior of the
iterated sequence.

8. Visualization:

- Render the image using the computed colors for each pixel.

- Display or save the image to visualize the Julia set.

Here's a Python-like pseudocode example for visualizing Julia sets:

```python

# Define parameters

width, height = 800, 800

xmin, xmax = -2, 2


ymin, ymax = -2, 2

max_iter = 100

c = complex(-0.8, 0.156) # Complex constant for the function f(z) = z^2 + c

# Iterate over pixels

for x from 0 to width - 1:

for y from 0 to height - 1:

# Map pixel coordinates to complex plane

cx = xmin + x * (xmax - xmin) / width

cy = ymin + y * (ymax - ymin) / height

z = complex(cx, cy)

# Iterate complex function

n=0

while abs(z) <= 2 and n < max_iter:

z = z**2 + c

n += 1

# Assign color based on set membership

if abs(z) <= 2:

color = compute_color(n)

set_pixel_color(x, y, color)

else:
set_pixel_color(x, y, background_color)

# Display or save the image

display_or_save_image("julia_set.png")

```

In this example, we visualize the Julia set for the function \( f(z) = z^2 + c \),
where \( c = -0.8 + 0.156i \). You can experiment with different complex
constants \( c \) and functions to explore different Julia sets.

Random fractals:

Fractal like patterns are generated in random process. In deterministic fractals we


use iterative mathematical algorithms.

In random fractals, we use probability distributions.

Overview of Ray Tracing:

• Ray tracing

Ray tracing simulates light and optics through sophisticated algorithms. It


renders by shooting out rays from the camera/view source and records the
effects of the ray hitting on different materials at different angles
considering the position of the light source. It is capable of producing
highly realistic images and renders compared to other methods.

The rendering time is very slow since the ray is simulated and calculated
for each pixel on the screen. That’s why producing VFX films cost more
and require high computation power requiring GPU specially made to
render films(render farms).

It can stimulate reflection, refraction, depth of field, and many other


realistic optical imagery techniques.
BEHAVIOUR OF RAY IN DIFFERENT MATERIALS

A simple algorithm for Ray Tracing can be expressed as follows:

for every pixel on the view-cone:

1. shoot out a ray from the camera.

2. find the first intersecting object to the ray.

3. if it is a reflective material
• recursively shoot out rays from the reflected point based on the reflectivity
and the light bounce limit.
4. calculate the light intensity of each pixel.
Intersecting rays with other primitives: Adding Surface texture
In computer graphics, intersecting rays with other primitives is a
fundamental operation used in rendering to determine what objects are visible
in a scene, and where they intersect with a ray representing a camera's view.
This process is essential for ray tracing, a technique used to simulate the way
light interacts with objects in a scene.

Here's a general overview of how intersecting rays with other primitives


works:

1. Ray Definition:
- A ray in computer graphics is represented by its origin point and a direction
vector. The origin point is typically the position of the camera or the point
where the ray starts, and the direction vector indicates the direction in which
the ray extends.

2. Primitive Representation:
- Primitives are basic geometric shapes such as spheres, triangles, planes,
cubes, etc., that make up the objects in a scene. Primitives can be represented
in various ways, including mathematical equations (like the equation of a
sphere or plane) or sets of vertices and indices (for triangles).

3. Intersection Test:
- To determine whether a ray intersects with a primitive, specific
intersection tests are performed based on the type of primitive:
- For spheres, the ray-sphere intersection equation (quadratic equation) is
solved.
- For triangles, ray-triangle intersection tests like Möller–Trumbore
intersection algorithm can be used.
- For other primitives, custom intersection algorithms may be implemented
depending on their mathematical representation.

4. Closest Intersection:
- During the intersection tests, the closest intersection point to the ray's
origin (if any) is recorded. This is essential for determining which primitive is
visible at a given point along the ray's path. The distance between the ray's
origin and the intersection point is typically used to determine the closest
intersection.

5. Shading:
- Once the closest intersection point is found, various shading attributes at
that point are computed. These attributes may include the surface normal
(direction perpendicular to the surface), material properties (e.g., color,
reflectivity, transparency), texture coordinates (if textures are used), etc.

6. Ray Bounding (Optional):


- Ray bounding involves using hierarchical data structures (e.g., bounding
volume hierarchies) to accelerate the intersection tests. By quickly rejecting
primitives that cannot possibly intersect with the ray (based on their bounding
volumes), the efficiency of ray tracing algorithms can be greatly improved.

7. Recursive Ray Tracing (Optional):


- If the material at the intersection point is reflective or refractive, new rays
can be cast recursively in reflection or refraction directions to simulate
indirect lighting effects. This process can involve tracing rays in a recursive
manner until a certain depth is reached or until the rays no longer contribute
significantly to the final pixel color.
8. Final Pixel Color:
- Finally, the shading attributes and lighting contributions (both direct and
indirect) are combined to compute the final color of the pixel corresponding to
the intersection point. This color represents the appearance of the object as
seen from the camera's viewpoint.

9. Repeat for Each Pixel:


- The entire process described above is repeated for each pixel in the image,
generating rays for each pixel and determining their intersections with the
scene's primitives. This results in a complete image depicting the scene as
viewed from the camera.

By following these steps, ray tracing algorithms can generate highly realistic
images with accurate lighting, shading, and reflections, making them valuable
tools in various applications such as rendering for movies, video games, and
architectural visualization.

Reflections and transparency:

It is a transformation which produces a mirror image of an object. The mirror


image can be either about x-axis or y-axis. The object is rotated by180°.

Types of Reflection:

1. Reflection about the x-axis


2. Reflection about the y-axis
3. Reflection about an axis perpendicular to xy plane and passing through the
origin
4. Reflection about line y=x

1. Reflection about x-axis: The object can be reflected about x-axis with the help
of the following matrix
In this transformation value of x will remain same whereas the value of y will
become negative. Following figures shows the reflection of the object axis. The
object will lie another side of the x-axis.

2. Reflection about y-axis: The object can be reflected about y-axis with the help
of following transformation matrix:
3. Reflection about an axis perpendicular to xy plane and passing through
origin:
In the matrix of this transformation is given below
In this value of x and y both will be reversed. This is also called as half revolution
about the origin.

4. Reflection about line y=x: The object may be reflected about line y = x with
the help of following transformation matrix

First of all, the object is rotated at 45°. The direction of rotation is clockwise. After
it reflection is done concerning x-axis. The last step is the rotation of y=x back to
its original position that is counterclockwise at 45°.

Transparency in Computer Graphics;

Transparency is a common feature in computer graphics, whether you want


to create realistic glass, water, smoke, or other effects. However, rendering
transparent objects can be challenging, as you need to account for how light
interacts with them and how they blend with the background.

What is transparency?

Transparency is the property of an object that allows some light to pass


through it, while reflecting or refracting the rest. Depending on the amount and
wavelength of light that is transmitted, an object can appear more or less
transparent. For example, a clear glass window is highly transparent, while a
colored glass bottle is partially transparent. Transparency can also vary across an
object, creating smooth or sharp transitions between opaque and transparent
regions.

How to model transparency?


To model transparency, you need to specify how much light is absorbed,
reflected, and refracted by an object. This can be done using different parameters,
such as opacity, alpha, transparency, or transmittance. Opacity is the inverse of
transparency, and measures how much light is blocked by an object.
Alpha is a value between 0 and 1 that represents the opacity of a pixel or a
fragment. Transparency is a color that indicates how much light of each
wavelength is transmitted by an object. Transmittance is a function that calculates
the amount of light that reaches the other side of an object.

How to render transparency?

To render transparency, you need to consider how transparent objects affect


the final color of a pixel. This depends on the rendering algorithm and the blending
mode you use. Rendering algorithms are methods to determine the visible surfaces
and the illumination of a scene.
Some common rendering algorithms are ray tracing, rasterization, and ray
marching. Blending modes are rules to combine the colors of overlapping pixels or
fragments. Some common blending modes are alpha blending, additive blending,
and subtractive blending.

What are the challenges of transparency?


Transparency poses some challenges for rendering, such as sorting, aliasing,
and depth testing. Sorting is the process of arranging transparent objects in a
specific order, usually from back to front, before rendering them. This is necessary
to ensure the correct blending of colors and avoid artifacts. However, sorting can
be difficult or impossible for complex or intersecting objects, such as hair, fur, or
foliage.

Aliasing is the distortion of edges or patterns caused by the limited


resolution of the screen or the sampling rate. This can create jagged or noisy
effects on transparent objects, especially when they are thin or moving. Depth
testing is the technique of discarding pixels or fragments that are occluded by
closer objects. This can improve the performance and accuracy of rendering, but it
can also cause problems for transparent objects, as they may be wrongly discarded
or occluded.

What are some solutions for transparency?


Transparency can be improved by employing various solutions, such as pre-
sorting, post-processing, depth peeling, and stochastic transparency. Pre-sorting
can reduce sorting cost and artifacts, but may not work for dynamic or overlapping
objects. Post-processing can enhance the appearance and smoothness of
transparent objects, but can also increase computational cost and latency.

Depth peeling can avoid sorting and depth testing issues, but is expensive and
memory-intensive. Stochastic transparency can create a natural and smooth effect,
but can also introduce noise and variance that require more samples to reduce
them.

Boolean Operations on Objects:

Boolean operations are a powerful tool for creating complex shapes and
forms in 3D modeling. They allow you to combine, subtract, or intersect two or
more objects using different modes. However, choosing the right Boolean
operation for your modeling goal can be tricky, as each mode has its own
advantages and disadvantages. In this article, we will explain the basics of Boolean
operations, the common modes and their effects, and some tips and best practices
for using them effectively.
What are Boolean operations?

Boolean operations are named after George Boole, a 19th-century mathematician


who developed a system of logic based on binary values: true or false, on or off, 1
or 0. In 3D modeling, Boolean operations use these values to determine which
parts of two or more objects should be kept or discarded when they are combined.

For example, if you want to create a hole in a cube, you can use a Boolean
operation to subtract a cylinder from the cube, leaving only the parts of the cube
that are not occupied by the cylinder.

What are the common modes of Boolean operations?


There are four common modes of Boolean operations in most 3D modeling
software:
union,
difference,
intersection, and
inverse.

Each mode has a different effect on the resulting object, based on the order
and orientation of the operands.
Union combines the operands into one object, keeping all parts from either
one or both.
Difference subtracts the second operand from the first, keeping only those
parts from the first one.
Intersection keeps only those parts belonging to both operands, discarding
the rest.
Inverse reverses the effect of the other modes, discarding what would be
kept and keeping what would be discarded.
For instance, unioning two spheres will create a shape resembling a peanut;
differencing a sphere from a cube will leave a cube with a spherical hole;
intersecting two spheres will give a shape resembling a lens; and inverting a union
of two spheres will create a crescent-like shape.

How do you choose the right mode for your modeling goal?
Choosing the correct mode for your modeling goal depends on several factors,
such as the size and shape of the operands, the desired outcome, and the level of
detail and complexity.
Generally, Union mode is used when you want to create a new shape by
combining two or more objects, or when you need to simplify your geometry by
merging overlapping objects. Difference mode is employed when you wish to
create a hole, a cut, or a notch in an object by removing another object from it, or
to create a negative space or silhouette. Intersection mode is used when you want
to create a shape defined by the overlap of two or more objects, or to isolate a
common area or cross-section.
Lastly, Inverse mode is selected when you need to create a shape defined by
the opposite of the overlap of two or more objects, or when you want to generate a
hollow or gap.

Best practices for using Boolean operations?


Boolean operations can be a great tool for creating complex shapes and
forms, but if not used properly, they can cause problems. To use them effectively,
you should plan ahead and consider the shape and size of the operands, the mode
and order of the operation, and the possible outcomes. Additionally, make sure
your objects have no errors or issues before you perform a Boolean operation.
Most 3D modeling software offer various settings and options for Boolean
operations which you can adjust according to your needs. Finally, optimize your
mesh by deleting, merging, or simplifying geometry that is not essential or visible
for your modeling goal.

What are some examples of Boolean operations in 3D modeling?


To demonstrate the capabilities of Boolean operations in 3D modeling, here are
some examples of how they can be used to create different shapes and forms.

A difference operation can be used to subtract a shape from a plane,


creating a cookie cutter effect, such as a star-shaped hole in the plane. A union
operation can combine a cylinder and a torus, creating a pipe effect, such as a
cylindrical shape with a circular hole in it.

An intersection operation can keep the overlap of two tori, creating a ring
effect, such as a toroidal shape with a smaller hole in it. An inverse
operation can reverse the effect of a difference operation, creating a cheese
effect, such as a cubic shape with spherical holes in it.
General Computer 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.

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.

Applications of Computer Animation:


Methods/Techniques:

1. 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.

2. 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.

3. Behavioral:

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.

4. 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.
5. 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.

6. 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.

Design of Animation Sequence:

Design of animation sequence involves the following steps:

1. Story Board Layout


2. Object definition
3. Key Frame Specifications
4. In between Frame Generation

Story Board layout:

It is basically the layout of what action is going to happen in an animation. It


defines the motion sequence 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 basic ideas.

Example:
Story Board Layout

1. In our animation an apple falls from the tree and bounces on the ground.
2. Then a bird flies and swirls around the air to see if any danger is there.
3. Then it sits on the apple picks it up and flies away.

Object Definition:

It is the process of defining the characteristics of the object present in the


scene. Objects can be defined in terms of polygons or splines. In addition
associated movements are specified for the objects along with the shape.

For the above example the Object definition would be:

a. Tree
b. Apple
c. Mud
d. Bird

Key frame definition:

This is the detailed drawing of a scene at a certain time in the animation


sequence. With each keyframe each object is positioned according to the time of
that frame .

Inbetween frame generation:

In computer graphics and animation, inbetweening (also known as "tweening" or


"interpolation") is the process of generating intermediate frames between two key
frames to create smooth transitions and motion. These intermediate frames fill in
the gaps between key frames, allowing for fluid and natural-looking animations.
Inbetweening is widely used in 2D and 3D animation, motion graphics, and
computer-generated imagery (CGI) to produce lifelike movement.

Animation Functions:

1. 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.

Example:

The process of Morphing involves three steps:

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.

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.
2. 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.

3. 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.
4. 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.

5. 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 center, 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 center, the object comes
inside the window appear small. This feature is known as Zooming Out.

6.Fractals: Fractal Function is used to generate a complex picture by using


Iteration. Iteration means the repetition of a single formula again & again with
slightly different value based on the previous iteration result. These results are
displayed on the screen in the form of the display picture.
Raster Animation :

Computer Images are made up of a bitmap or grid called the “raster graphics”
Raster graphics make up the majority of images on the web and on our computer.
They are one of the two main picture types used in vector graphics on computers.
A raster graphic’s file size relies on a number of factors. The first is the raster
graphic’s resolution or the size of the image in terms of pixels.

Basic Terms Related to Raster Graphics

Here the some basic terms of the raster graphics.

Pixel: In computer graphics, an actual point in a picture is called a pixel, dot, or


image element. Pixels are the smallest addressable units in an image that is shown
on a screen. Almost everything we see on computer displays is composed of
raster graphics. A selfie taken with your phone is an example of a raster image as
well. To make an image, a bitmap, or collection of pixels, is utilized.

Bitmap: A bitmap in computer graphics is a mapping between a domain and bits,


or values that can only have one or zero values. There are other names for it, such
as bit array or bitmap index. More broadly speaking, a “pixmap” is a map of
pixels that have more than two colors stored in each pixel, or more than one bit
per pixel. For that too, the bitmap is widely employed. The phrase “bitmap”
refers to one bit per pixel in certain situations, whereas pixmap is used for images
with several bits per pixel.

How Images are Stored in Raster Graphics?

Computer images are generally stored in raster graphics formats, such as GIF,
JPEG, and PNG, which are commonly used on the Web. Tessellation of a two-
dimensional plane into cells, each containing a single value is the basis of a raster
data format. Before the data can be saved in a file, the two-dimensional array
must be serialized. A row-major format lists the cells from left to right starting
with the ones along the first (often top) row, then the cells along the second row,
and so on.

Benefits of Raster Graphics:

Looks Real: Raster graphics are useful for producing photographs-like images.

Used on the Internet: This is the process used to make many of the images you
see on the Internet.

Easy to Change: A computer may be used to simply modify these photographs.

Lots of Colors: A large range of smooth colors are possible for raster graphics.

Useful for Web Images: The images you see on websites, social media, and other
online platforms are often created using raster graphics. They load quickly and
look good on screens.

Three-Dimensional Raster’s

Three-dimensional raster graphics are used.to video games as well as medical


imaging devices like MRI scanners.

Key Frame Systems

Keyframe systems in computer graphics are essential tools used to define


and control animation sequences. They allow animators to specify key poses or
key states at specific points in time, from which the animation software generates
intermediate frames to create smooth motion transitions. Keyframe systems are
widely used in both 2D and 3D animation, as well as in motion graphics and
computer-generated effects.

Here's an overview of keyframe systems in computer graphics:


1. Keyframes:

- Keyframes are specific frames within an animation sequence that define


important poses, positions, or states of objects or characters. These keyframes
serve as reference points for the animation, indicating significant changes in
movement, position, or attribute values (such as rotation, scale, or color).

2. Interpolation:

- Between consecutive keyframes, animation software interpolates the values of


attributes (e.g., position, rotation, scale) to generate smooth transitions and
motion. This interpolation process calculates the intermediate frames that bridge
the gap between keyframes, creating fluid animation sequences.

3. Attributes:

- Keyframe systems allow animators to set and manipulate various attributes for
each keyframe, such as:

- Position: The spatial coordinates of objects or characters.

- Rotation: The orientation or angle of objects or characters.

- Scale: The size or scale factor of objects or characters.

- Color: The color values for objects or materials.

- Other properties: Additional attributes relevant to the animation, such as


transparency, texture mapping, or deformation parameters.

4. Timeline and Graph Editor:

- Keyframe systems typically include a timeline or graph editor interface where


animators can visually organize and manipulate keyframes. The timeline displays
keyframes along a timeline, allowing animators to adjust their timing and
spacing. The graph editor provides a graphical representation of attribute curves
over time, enabling animators to fine-tune animation trajectories and timing
curves.

5. Ease Curves:

- Animators can control the timing and easing of animations by adjusting ease
curves or interpolation curves between keyframes. These curves determine how
attribute values change over time, affecting the speed and acceleration of motion
transitions.

6. Manipulation and Editing:

- Keyframe systems provide tools for animators to manipulate and edit


keyframes interactively. This includes functions for adding, deleting, copying,
and moving keyframes, as well as tools for adjusting attribute values directly or
through numerical input.

7. Hierarchy and Constraints (in 3D animation):

- In 3D animation, keyframe systems often support hierarchical relationships


and constraints between objects. This allows animators to define parent-child
relationships and constraints that govern the behavior of objects in the animation.

Keyframe systems are powerful tools that enable animators to create complex and
expressive animations by defining key poses and transitions in an intuitive and
efficient manner. They form the backbone of animation production pipelines,
facilitating the creation of dynamic and visually appealing motion sequences in
computer graphics.
Motion Specification – Morphing and Tweening

Motion specification in computer animation involves defining how objects


or characters move and transform over time. Two common techniques used for
motion specification are morphing and tweening.

1. Morphing:

- Morphing, short for metamorphosis, is a technique used to smoothly transform


one object or shape into another over a specified period of time. It involves
interpolating between the vertices of two or more objects or shapes to create a
seamless transition between them.

- In morphing, key shapes or keyframes are defined at the beginning and end of
the transformation. These key shapes represent the starting and ending states of
the morphing process.

- Intermediate frames are generated by linearly interpolating between


corresponding vertices of the key shapes. This interpolation creates a series of
blended shapes that smoothly transition from the starting shape to the ending
shape.

- Morphing is often used for transforming one object or character into another,
such as transforming a human face into an animal face or changing the shape of a
logo.

2. Tweening (Interpolation):

- Tweening, short for inbetweening or interpolation, is a technique used to


generate intermediate frames between keyframes to create smooth motion
transitions.

- In tweening, keyframes are defined at key points in time, representing


important poses or positions of objects or characters.
- Intermediate frames, known as tweens, are generated by interpolating attribute
values (such as position, rotation, scale) between consecutive keyframes. This
interpolation creates smooth motion transitions between key poses.

- Tweening can be applied to various types of animation, including 2D


animation (such as traditional hand-drawn animation or vector-based animation)
and 3D animation.

- Common interpolation methods used in tweening include linear interpolation


(LERP), Bezier interpolation, and spline interpolation. These methods allow
animators to control the timing, easing, and curvature of motion transitions.

- Tweening is widely used for animating characters, objects, and effects in


computer-generated animation, motion graphics, and interactive applications.

Morphing and tweening are both techniques used for motion specification
in computer animation. Morphing is used to smoothly transform one object or
shape into another, while tweening is used to generate smooth motion transitions
between keyframes. Both techniques are essential tools for creating dynamic and
visually appealing animations in computer graphics.

You might also like