Visvesvaraya Technological University BELGAUM-590014: "Depiction of Seasons Using Leaves"
Visvesvaraya Technological University BELGAUM-590014: "Depiction of Seasons Using Leaves"
Submitted by:
A.APARNA (1DT14CS001)
AND
ABHILASH SINGH (1DT14CS003)
CERTIFICATE
This is to certify that the Mini-Project on Computer Graphics and Visualization work entitled
“DEPICTION OF SEASONS USING LEAVES” has been successfully carried out by
A.APARNA (1DT14CS001) and ABHILASH SINGH (1DT14CS003) , bonafide students
of Dayananda Sagar Academy of Technology and Management in partial fulfillment of
the requirements for the award of degree in Bachelor of Engineering in Computer Science
and Engineering of Visvesvaraya Technological University, Belgaum during academic
year 2016-2017. It is certified that all corrections/suggestions indicated for Internal
Assessment have been incorporated in the report deposited in the departmental library. The
mini project report has been approved as it satisfies the academic requirements in respect of
project work for the said degree.
GUIDES:
Mr.RAGHU.M.T
(Asst. Prof. Dept of CSE)
Dr. C. NANDINI
(Vice Principal &HOD, Dept. of CSE)
Examiners: Signature with Date
1:
2:
ACKNOWLEDGEMENT
We are very grateful to our institution, Dayananda Sagar Academy of Technology And
Management with its ideals and inspirations for having provided with facilities, which has
made this mini project a success.
We are grateful to Dr. C. NANDINI, Vice Principal and H.O.D, Department of CSE,
Dayananda Sagar Academy of Technology and Management, for her unfailing
encouragement and suggestions given to us in course of our mini project work.
A.APARNA(1DT14CS001)
ABHILASH SINGH(1DT14CS003)
ABSTRACT
Dept of CSE, DSATM 2016-17 Page |3
Depiction of Seasons through a Leaf
Most modern day calendars around the world divide the year into 4 seasons: spring, summer,
fall (autumn), and winter.
The project enables the user to choose one of these four seasons. The seasons are portrayed
using a leaf. The different shades of nature and the leaf will show us how each season has its
unique characteristics.
The project requires the usage of menus, Therefore the menu function will be implemented.
We can choose from a variety of seasons using the menus option and the leaves appear based
on the particular season that has been opted and with their respective characteristic that may
include colour, texture, etc of that season.
TABLE OF CONTENTS
CHAPTER1: INTRODUCTION
CHAPTER 1
INTRODUCTION
Before the invention of computer graphics people used to display the information manually either by
drawing or creating model which resembles real environment. For example the Greeks were able to
convey their architectural ideas graphically using drawing. Today the same type of information is
generated by architects, mechanical engineers and draftsman using computer based graphics system.
Our interaction with computers has become dominated by a visual paradigm that includes
windows, icons, menus and a pointing device, such as a mouse. From a user’s Perspective,
windowing System such as the X windows system, Microsoft’s Windows. Although we are familiar
with the style of graphical user interface used on most workstations, advances in computer graphics
have made possible other forms of interfaces.
1.2 OVERVIEW
Nature truly displays its color palette throughout the 4 seasons (spring, summer, winter and
fall). For years, scientists have worked to understand the changes that happen to trees and
shrubs in the. Although we don't know all the details, we do know enough to explain the
basics and help enjoy more fully Nature's multicolored display. Three factors influence leaf
color-leaf pigments, length of night, and weather, but not quite in the way we think. The
timing of color change and leaf fall are primarily regulated by the calendar, that is, the
increasing length of night. None of the other environmental influences-temperature, rainfall,
food supply, and so on-are as unvarying as the steadily increasing length of night during
autumn. As days grow shorter, and nights grow longer and cooler, biochemical processes in
the leaf begin to paint the landscape with Nature's palette.
1.5 MOTIVATION
The concept of openGL primitive and openGL transformation functions have motivated the
creation of this project. The lab programs were a motivation to bring some animation effects
Dept of CSE, DSATM 2016-17 Page |7
Depiction of Seasons through a Leaf
which includes all the functions learnt in computer graphics subject and learn more effects .
1.7 OPENGL
OpenGL (Open Graphics Library) is a standard specification defining a cross language cross
platform API for writing applications that produce 2D and 3D computer graphics. The
interface consists of over 250 different function calls which can be used to draw complex 3D
scenes from simple primitives. OpenGL was developed by Silicon Graphics Inc. (SGI) in
1992 and is widely used in CAD, virtual reality, scientific visualization, information
visualization and flight simulation. It is also used in video games, where it competes with
direct 3D on Microsoft Windows Platforms. OpenGL is managed by the nonprofit
technology consortium, the Khronos group Inc.
All data, whether it describes geometry or pixels, can be saved in a display list for
current or later use. When a display list is executed, the retained data is sent from the
display list just as if it were sent by the application in immediate mode.
Evaluators :
All geometric primitives are eventually described by vertices. Parametric curves and
surfaces may be initially described by control points and polynomial functions called
basis functions.
Per Vertex Operations :
For vertex data, next is the “per-vertex operations” stage, which converts the vertices
into primitives. Some vertex data are transformed by 4 x 4 floating-point matrices.
Spatial coordinates are projected from a position in the 3D world to a position on
your screen.
Primitive Assembly :
Pixel Operation:
While geometric data takes one path through the OpenGL rendering pipeline, pixel
data takes a different route. Pixels from an array in system memory are first unpacked
from one of a variety of formats into the proper number of components. Next the data
is scaled, biased, and processed by a pixel map. The results are clamped and then
either written into texture memory or sent to the rasterization step.
Rasterization:
Rasterization is the conversion of both geometric and pixel data into fragments. Each
fragment square corresponds to a pixel in the frame buffer. Color and depth values
are assigned for each fragment square.
Fragment Operations :
Before values are actually stored into the frame buffer, a series of operations are
performed that may alter or even throw out fragments. All these operations can be
enabled or disabled.
action between users and computers the built in graphics provided with user interfaces use
the control items.
In industry, business government and education organization’s computer graphics ismost
commonly used to create 2D and 3D graphs of mathematical, physical and
economicfunctions in the form of histograms, bars and pie charts which are very useful in
decisionmaking.
CHAPTER 2
LITERATURE SURVEY
Dept of CSE, DSATM 2016-17 P a g e | 12
Depiction of Seasons through a Leaf
During the spring and summer the leaves have served as factories where most of the foods
necessary for the tree's growth are manufactured. This food-making process takes place in the
leaf in numerous cells containing chlorophyll, which gives the leaf its green color. This
extraordinary chemical absorbs from sunlight the energy that is used in transforming carbon
dioxide and water to carbohydrates, such as sugars and starch.
Along with the green pigment are yellow to orange pigments, carotenes and xanthophyll
pigments which, for example, give the orange color to a carrot. Most of the year these colors
are masked by great amounts of green coloring.
But in the fall, because of changes in the length of daylight and changes in temperature, the
leaves stop their food-making process. The chlorophyll breaks down, the green color
disappears, and the yellow to orange colors become visible and give the leaves part of their
fall splendor.
At the same time other chemical changes may occur, which form additional colors through
the development of red anthocyanin pigments. Some mixtures give rise to the reddish and
purplish fall colors of trees such as dogwoods and sumacs, while others give the sugar maple
its brilliant orange.
The autumn foliage of some trees show only yellow colors. Others, like many oaks, display
mostly browns. All these colors are due to the mixing of varying amounts of the chlorophyll
residue and other pigments in the leaf during the fall season.
A color palette needs pigments, and there are three types that are involved in leaf color:
Chlorophyll, which gives leaves their basic green color. It is necessary for
In the late 1960’s the development of Free-form curves and surfaces for computer graphics
begins. Free form curves and surfaces were developed to describe curved 3D objects without
using polyhedral representations which are bulky and intractable. To get a precise curve with
polygons might require thousands of faces, whereas curved surfaces requires much less
calculations. The UNISURF CAD system was created for designing cars which utilized the
curve theories.
The rapid increase in the performance of graphics hardware, coupled with recent
improvements in its programmability, have made graphics hardware a compelling platform
for computationally demanding tasks in a wide variety of application domains. In this report,
we describe, summarize, and analyze the latest research in mapping general-purpose
computation to graphics hardware.
2.2RELATED WORK
Dept of CSE, DSATM 2016-17 P a g e | 15
Depiction of Seasons through a Leaf
The user controls the color of the leaves by selecting a season from the options in the
displayed menu. According to the season the falling leaves change into the assigned color.
The colors assigned for the seasons are:
Spring: Green
Summer: Yellow
Winter: Brown
Fall: Red
If the package is being used from the designing end, then the user may also control the
number of the leaves, the rotation speed, the speed at which the leaves are falling and other
such functions.
CHAPTER 3
SYSTEM REQUIREMENTS
HARDWARE CONSTRAINTS:
CHAPTER 4
DESIGN
Dept of CSE, DSATM 2016-17 P a g e | 17
Depiction of Seasons through a Leaf
MENU( )
DISPLAY( )
LEAF( )
1. SPRING( )
MENU( ) 2. SUMMER( )
3. WINTER( )
4. FALL( )
END 5. QUIT( )
CHAPTER 5
IMPLEMENTATION
MODULE2: LEAF
This function uses the translate, rotate, and scale function to display the leaf at the mentioned
position. It uses various vertex functions to display the stem , leaf and veins of the leaf.
MODULE3: MENU
This class describes the menu to be displayed which provides options to choose or select a
particular season. It also provides option to quit or terminate the program.
MODULE4:MAIN
The main function uses all these functions and through the help of menu and mouse
interactions lets the users change the color of the leaf. The display stops when the user selects
the quit option.
display ( )
{
Both the x and y coordinate axes are drawn. The transformation of leaves’ color is controlled
using a for loop. Speed at which leaf falls is monitored using the the y coordinate value and
the size of the leaf
}
Spring( )
{
Specifies weather color values for green color.
}
Summer( )
{
Winter( )
{
Dept of CSE, DSATM 2016-17 P a g e | 21
Depiction of Seasons through a Leaf
Fall( )
{
RAND
Syntax:
rand( );
Description:
Parameters:
Milliseconds for which the program must sleep.
Description:
Specifies time for which program must sleep.
TRANSLATE FUNCTION
Syntax:
glTranslatef( x,y,z);
Parameters:
x, y and z values
Description:
Accepts axis along which it must translate the object.
ROTATE FUNCTION
Syntax:
glRotatef( angle,x,y,z);
Parameters:
Angle of rotation, x, y and z values.
Description:
Accepts the angle of rotation and x, y and z values.
SCALE FUNCTION
Syntax:
glScalef(size,size,size);
Parameters:
Sizes of scaling in all three axes.
Description:
Accepts scaling factor for all three axes.
POST REDISPLAY
Syntax:
Void glutPostRedisplay( );
Description:
glutPostRedisplay marks the normal plane of current window as needing to be redisplayed.
glutPostRedisplay may be called within a window's display or overlay display callback to re-
mark that window for redisplay.
COLOR FUNCTION
Syntax :
glColor3f(red, green , blue);
Parameters :
Description:
This function accepts different colors.
CHAPTER 6
SNAPSHOTS
FIG.6.1 SPRING
FI
G 6.2 SUMMER
CHAPTER 7
BIBLIOGRAPHY
th
[1] The Red Book-OpenGL programming Guide,6 edition
[2] Edward Angel Interactive Computer Graphics A Top-Down Approach with OpenGL,
5th edition, Addison and Wesley
[3] Donald Hearn and Pauline Baker: Computer Graphics- OpenGl version, 3 rdedition,
Pearson Education
[4] F.S. Hill Jr.: Computer Graphics Using OpenGL,3rdedition, PHI.
Websites:
http://www.opengl.org/registry/
www.na.fs.fed.us
www.openglforum.com
http://www.esf.edu
www.vtucs.com