CGR 2
CGR 2
CGR 2
CHAPTER 1
INTRODUCTION
Today, computers and computer-generated images touch many aspects of daily life.
Computer image is found on television, in newspapers, for example in weather reports,
in all kinds of medical investigation and surgical procedures. A well constructed graph
can present complex statistics in a form that is easier to understand and interpret. In
the media such graphs are used to illustrate papers, reports, and other presentation
material.
Many powerful tools have been developed to visualize data. Computer generated
imagery can be categorized into several different types: 2D, 3D, 5D, and animated
graphics. As technology has improved, 3D computer graphics have become more
common, but 2D computer graphics are still widely used. Computer graphics has
emerged as a sub-field of computer science which studies methods for digitally
synthesizing and manipulating visual content. Over the past decade, other specialized
fields have been developed like information visualization, and scientific visualization
more concerned with “the visualization of three dimensional phenomena”
(architectural, meteorological, medical, biological, etc.), where emphasis is on realistic
renderings of volumes, surfaces, illumination sources, and so forth, perhaps with a
dynamic (time component).
Nowadays Computer Graphics used in almost all the areas ranges from science,
engineering, medicine, business, industry government, art, entertainment, education
and training.
Computer-Aided Design:
Computer generated models of physical, financial, political, social, and economic &
other systems are often used as educational aids. For some training applications,
special hardware systems are designed. Examples of such specialized systems are the
simulators for practice sessions, aircraft pilots, and air traffic-control personnel.
Entertainment:
Television production, motion pictures, and music videos routinely computer graphics
methods. Some television programs also use animation techniques to combine
computer generated figures of people, animals, or cartoon characters with the actor in
a scene or to transform an actor’s face into another shape.
Computer Art:
The picture is usually painted electronically on a graphics tablet using a stylus, which
can simulate different brush strokes, brush widths and colours. Fine artists use a variety
of other computer technologies to produce images. To create pictures the artist uses a
combination of 3D modelling packages, texture mapping, drawing programs and CAD
software etc.
User Interface:
OpenGL basic (core) library: A basic library of functions is provided in OpenGL for
specifying graphics primitives, attributes, geometric transformations, viewing
transformations, and many other operations.
Function names in the OpenGL basic library (also called the OpenGL core library) are
prefixed with gl. The component word first letter is capitalized. For eg:- glBegin,
glClear, glCopyPixels, glPolygonMode.
Symbolic constants that are used with certain functions as parameters are all in capital
letters, preceded by “GL”, and component are separated by underscore. For eg:-
GL_2D, GL_RGB etc. The OpenGL functions also expect specific data types. For
example, an OpenGL function parameter might expect a value that is specified as a 32-
bit integer. To indicate a specific data type, OpenGL uses special built-in, datatype
names, such as GLbyte, GLshort, GLint, GLfloat, GLdouble, GLboolean.
Stable:
OpenGL implementations have been available for more than seven years on a wide
variety of platforms. Additions to the specification are well controlled, and proposed
updates are announced in time for developers to adopt changes. Backward
compatibility requirements ensure that existing applications do not become obsolete.
All OpenGL applications produce consistent visual display results on any OpenGL
API- compliant hardware, regardless of operating system or windowing system.
Scalable:
Easy to use:
OpenGL is well structured with an intuitive design and logical commands. Efficient
OpenGL routines typically result in applications with fewer lines of code than those
that make up programs generated using other graphics libraries or packages. In
addition, OpenGL drivers encapsulate information about the underlying hardware,
freeing the application developer from having to design for specific hardware features.
Well-documented:
Numerous books have been published about OpenGL, and a great deal of sample code
is readily available, making information about OpenGL inexpensive and easy to obtain.
GL – Graphics Library:
Functions in the main GL (or OpenGL in Windows) library have names that
begin with the letters gl and are stored in a library usually referred to as GL (or OpenGL
in Windows).
This library uses only GL functions but contain code for creating common objects and
simplifying viewing. All functions in GLU can be created from the core GL library but
application programmers prefer not to write the code repeatedly. The GLU library is
available in all OpenGL implementations; functions in the GLU library begins with the
letters glu.
To interface with the window system and to get input from external devices into our
programs we need at least one more library. For the X window System, this library is
called GLX, for Windows, it is wgl, and for the Macintosh, it is agl. Rather than using
a different library for each system, we use a readily available library called the OpenGL
Utility Toolkit (GLUT) , which provides minimum functionality that should be
expected in any modern windowing system.
CHAPTER 2
SYSTEM REQUIREMENTS
• Intel®i5
• 6GB RAM
• Hard Disk: 40 GB
• Hard disk speed in RPM: 5400 RPM
• Mouse: 2 or 3 Button mouse
• Monitor: 1024 x 768 display resolution
• Keyboard: QWERTY Keyboard
CHAPTER 3
SYSTEM DESIGN
3.1 INITIALIZATION:
• Initialize the display mode that is double buffer and RGB colour system.
3.2 DISPLAY:
Sunrise Page.
Keys will be provided.
Suitable operations will be performed According to your need.
Sunset Page
CHAPTER 4
Main aim of this project is to illustrate the concepts of Nature Scenery with College
Buildings in OpenGL. The objects are drawn using the GLUT functions. This project
has been developed using Code::Blocks IDE on Windows 10 operating system with
OpenGL package
4.1 Overview:
Our computer graphics project titled "Nature Scenery with College Buildings" aims to
create a captivating and immersive digital representation of a college campus harmoniously
integrated with the beauty of the natural environment. Through meticulous attention to detail
and innovative design techniques, we seek to showcase the seamless blend of architectural
brilliance with elements such as the vast sky, gracefully soaring birds, ethereal clouds,
mesmerizing sunrises or sunsets, and vibrant green grass. By combining the serene tranquility
of nature with the educational realm of a college campus, our project endeavors to inspire
viewers to appreciate the delicate balance between human creativity and the awe-inspiring
beauty of the natural world, fostering a sense of environmental consciousness and preservation.
The Majesty of the Sky : The sky plays a vital role in our nature scenery, serving as a canvas
that showcases the ever-changing beauty of nature. Through dynamic sky rendering
techniques, we simulate the progression of time, transitioning seamlessly from the soft hues of
dawn to the vibrant colors of sunset. The patterns of clouds add a sense of dynamism to the
scene, and contributing to the overall visual richness. By accurately representing the sky's
colors, and atmospheric effects, we aim to evoke a sense of awe and appreciation for the
vastness and grandeur of the natural world.
Graceful Birds in Flight : Birds soaring through the sky bring an element of life to the nature
scenery with college buildings. These animated elements add a dynamic and lively dimension
to the project, evoking a sense of freedom, harmony, and the interconnectedness of all living
beings within the natural world.
Capturing the Beauty of Sunrise and Sunset : The serene beauty of sunrises and sunsets casts
a captivating aura over the nature scenery with college buildings. Through intricate color
schemes, we aim to recreate the breathtaking hues that fill the sky during these magical
moments. The blue and warm golden tones of a sunrise or the vivid oranges and red of a sunset
create a visually stunning backdrop, enhancing the overall aesthetic appeal of the scene and
conveying a sense of tranquility, inspiration, and the promise of new beginnings.
Lush Grass and Nature's Abundance : The presence of lush green grass is an integral part of
our nature scenery, symbolizing vitality, growth, and the harmony between human structures
and the natural environment. By utilizing modeling and texturing
4.2 Objective:
The primary objective of our computer graphics project, "Nature Scenery with College
Buildings," is to create a visually captivating and immersive digital representation that
seamlessly integrates the architectural beauty of college buildings with the enchanting
elements of nature. Through this project, we aim to achieve the following goals:
1. Realism and Immersion: Our objective is to create a nature scenery with college buildings
that is visually realistic and immersive, enabling viewers to feel a deep sense of connection
with the environment. By employing advanced rendering techniques, lifelike textures, and
accurate lighting simulations, we strive to transport viewers into a virtual world where the
boundaries between the man-made structures and the natural elements blur.
4. Emotional Impact: We aim to evoke emotional responses from viewers through our project.
By capturing the breathtaking beauty of sunrises and sunsets, the serenity of the sky, and the
vibrancy of nature, our objective is to elicit feelings of awe, tranquility, and a deep appreciation
for the natural world. We hope to inspire viewers to develop a stronger connection with nature,
fostering a sense of responsibility and a desire to protect and preserve our environment.
5. Educational Insight: Through our project, we aspire to provide an educational insight into
the coexistence of human architecture and nature. By showcasing the integration of college
buildings within a natural setting, we aim to highlight the importance of sustainable design,
eco-friendly practices, and the balance between human progress and environmental
preservation. Our objective is to inspire a broader understanding and appreciation of the
symbiotic relationship between human-made structures and the natural world.
The Project which we have done uses OpenGL functions and is implemented using C++.
Our Project is to demonstrate Nature Scenery with College Buildings. User can perform
operations using Mouse.
Mouse Interaction
CHAPTER 5
INTRODUCTION TO TESTING
TESTING:
Verification and validation are a generic name given to checking processes, which
ensures that the software conforms to its specifications and meets the demands of users.
• Validation: Are we building the right product? Validation involves checking that the
program has implanted meets the requirement of the users.
• Verification: Verification involves checking that the program confirms to its
specification.
Results:
Several errors were detected and rectified and the whole project is working as it should have
to work with proper output and high efficiency.
Test Test Steps to Expected result Actual Pass/
case case execute the result Fail
ID test case
Table 5.1 Testing for the “Nature Scenery with College Buildings” Project
CHAPTER 6
SNAPSHOTS
Starting display window when we build the program displaying the overview scene
Sunrise Window that is showing rising sun, birds, clouds, buildings with blue sky.
.
Figure 6.3. Nature Scenery with College Buildings Menu option Window
Window that is showing the Menu options like sunrise, sunset and exit provided for
the specific project
Sunset Window that is showing falling sun, birds, clouds, buildings with orange sky
CHAPTER 7
In conclusion, the provided code demonstrates a simple graphical application using OpenGL
and GLUT libraries. The application displays a scene with buildings, grass, and a sun that
moves across the sky. The user can switch between a sunrise and sunset view using a menu.
The code showcases fundamental concepts of OpenGL, including setting up the rendering
environment, drawing basic shapes, applying colors and lighting, handling user input, and
implementing basic animation. It provides a starting point for further exploration and
development of more complex graphical applications.
FUTURE ENHANCEMENT:
BIBLOGRAPHY
BOOKS:
• Donald Hearn & Pauline Baker: Computer Graphics with OpenGL Version,
3rd / 4th Edition, Pearson Education, 2011.
• Edward Angel: Interactive Computer Graphics- A Top Down approach with
OpenGL, 5th edition. Pearson Education, 2008.
• James D Foley, Andries Van Dam, Steven K Feiner, John F Huges Computer
graphics with OpenGL: pearson education
• Xiang, Plastock : Computer Graphics , sham‟s outline series, 2nd edition, TMG.
• Kelvin Sung, Peter Shirley, steven Baer : Interactive Computer Graphics,
concepts and applications, Cengage Learning
• Angel, Edward, and Dave Shreiner. "Interactive Computer Graphics: A
Top-Down Approach with Shader-Based OpenGL." Addison-Wesley Professional,
2011.
• Hawkins, David. "OpenGL Programming Guide: The Official Guide to
Learning OpenGL, Version 4.5 with SPIR-V." Addison-Wesley Professional, 2016.
• Woo, Mason et al. "OpenGL Insights." CRC Press, 2012.
FURTHER LINKS:
• www.google.com
• https://opengl.org/