Yashu CG Report-1
Yashu CG Report-1
Submitted by:
Ms. Yashaswini L[1JT20CS119]
Ms. Zainab Y[1JT20CS120]
The Institution aims at providing a vibrant, intellectually and emotionally rich teaching learning
environment with state of art infrastructure and recognizing and nurturing the potential of each
individual to evolve into one’s own self and contribute to the welfare of all.
CERTIFICATE
This is to certify that the mini project entitled ‘AQUARIUM’ carried out by Ms. Yashaswini L
[1JT20CS119], Ms. Zainab Y [1JT20CS120], a bonafide students of Jyothy Institute of Technology,
Bengaluru in partial fulfillment for Computer Graphics Laboratory with Mini Project (18CSL67) of
Bachelor of Engineering, in Computer Science and Engineering under Visvesvaraya Technological
University, Belagavi, during the year 2022-2023. It is certified that all corrections/suggestions indicated
have been incorporated in the report.
The report has been approved as it satisfies the academic requirements in respect of Mini Project,
prescribed for the said Bachelor's degree.
2.
DECLARATION
We, Ms. Yashaswini L, Ms. Zainab Y, students of 6th semester of Computer Science
and Engineering, Jyothy Institute of Technology, Tataguni, Bangalore - 560 082, declare that
the entire mini project “AQUARIUM” embodied in this report has been successfully
completed under the guidance of Mr. Navile Nageshwara Naveen, Assistant Professor ,
Dept of CSE, JIT, Bangalore. This mini project is submitted to the department of Computer
Science and Engineering, Jyothy Institute of Technology, Tataguni, Bangalore, in partial
fulfillment of the requirements for course Computer Graphics laboratory with mini project
(18CSL67), during the academic year 2022-2023.
Place: Bangalore
Date: 08/07/2023
This mini project is a result of accumulated guidance, direction and support of several important
persons. We take this opportunity to express our gratitude to all who have helped us to complete this
mini project.
We express our sincere thanks to our Principal Dr K Gopalakrishna, for providing us adequate
facilities to undertake this mini project.
We would like to thank Dr. Prabhanjan S, Professor and Head of Dept., - CSE, for providing us an
opportunity to carry out this mini project and for his valuable guidance and support.
We express our deep and profound gratitude to our guide, Mr. Navile Nageshwara Naveen, Asst.
Prof., Dept., of CSE, for his keen interest and encouragement at every step in completing the mini
project work.
We would like to thank all the faculty members of CSE department for the support extended during the
course of the mini project.
The development of any project will improve the users’ knowledge. The main aim of
developing this project is to improve our knowledge of Computer Graphics and OpenGL.
This project provides good understanding of conspicuous OpenGL functions like
Transformation Matrices, Translation, Rotation and Scaling.
Keeping factors of usability and simplicity in mind, the demonstrations of the basic
OpenGL functions and features are demonstrated.This project will demonstrate the use
of two- and three-dimensional planes in OpenGL. This project has detailed information
on user interaction.
The menu provides options to add fishes to the aquarium by the count of one, remove
fishes from the aquarium by the count of one, empty the tank completely resulting in zero
fishes, and the Quit option which will close the window. The fishes are assigned various
colors using a two-dimensional array and they make a motion with random speed.
Similarly, the bubbles and the crab also move with random speed. While the grass shows
a movement at the bottom-left of the aquarium with some angle, the decorative star is
static.
TABLE OF CONTENTS
2 LITERATURE SURVEY 7
3 REQUIREMENT ANALYSIS 9
4 IMPLEMENTATION 11
5 SNAPSHOTS 13
6 REFERENCES 17
7 APPENDIX 18
Aquarium Simulation
CHAPTER 1
INTRODUCTION
hardcopy technologies, input technologies and also display technologies. Some of the
hardcopy technologies are printers, pen plotters etc. Some of the display technologies
such direct view storage tube, liquid crystal displays, plasma panels etc. Input
technologies like keyboard, mouse, touch panel, tablets etc.
• Computer Simulation
A computer simulation, a computer model or a computational model is a computer
program, or network of computers, that attempts to simulate an abstract model of
particular system.
• Scientific Visualization
It is a branch of science, concerned with the visualization of 3D phenomena, such
as architectural, meteorological, medical, biological systems.
• Virtual Reality
It is a technology which allows a user to interact with a computer-simulated
environment. The simulated environment can be similar to the real world.
• Digital Art
Digital Art most commonly refers to art created on a computer in digital form.
• Web Design
It is the skill of designing presentations of content usually hypertext or
hypermedia that is delivered to an end-user through the World Wide Web, by way of a
web browser.
because it was developed before the X Window System and Sun's News systems were
developed.
In addition, SGI had a large number of software customers; by changing to the
OpenGL API they planned to keep their customers locked onto SGI (and IBM) hardware
for a few years while market support for OpenGL matured. Meanwhile, SGI would
continue to try to maintain their customers tied to SGI hardware by developing the
advanced and proprietary Iris Inventor and Iris Performer programming APIs. As a result,
SGI released the OpenGL standard.
The OpenGL standardized access to hardware, and pushed the development
responsibility of hardware interface programs, sometimes called device drivers, to
hardware manufacturers and delegated windowing functions to the underlying operating
system. With so many different kinds of graphic hardware, getting them all speak the
same language in this way had a remarkable impact by giving software developers a
higher level platform for 3D-software development.
In 1992 SGI led the creation of the OpenGL architectural review board (OpenGL
ARB), the group of companies that would maintain and expand the OpenGL specification
for years to come. OpenGL evolved from (and is very similar in style to) SGI's earlier 3D
interface, IrisGL. One of the restrictions of IrisGL was that it only provided access to
features supported by the underlying hardware. If the graphics hardware did not support a
feature, then the application could not use it. OpenGL overcame this problem by
providing support in software for features unsupported by hardware, allowing
applications to use advanced graphics on relatively low-powered systems.
• It has traditionally used a confusing state select model where you bind objects or
bind state, which changes which state other functions change. Too bad the old
functions are still available.
• OpenGL which leads to deprecation. For each new OpenGL version, the number
of API functions explodes.
CHAPTER 2
LITERATURE SURVEY
2.1 Survey on 3D Shapes:
Content-based shape retrieval techniques can facilitate 3D model resource
reuse, 3D model modeling, object recognition, and 3D content classification. Recently
more and more researchers have attempted to solve the problems of partial retrieval in
the domain of computer graphics, vision, CAD, and multimedia. Unfortunately, in the
literature, there is little comprehensive discussion on the state-of-the-art methods of
partial shape retrieval. In this article we focus on reviewing the partial shape retrieval
methods over the last decade, and help novices to grasp latest developments in this
field. We first give the definition of partial retrieval and discuss its desirable
capabilities. Secondly, we classify the existing methods on partial shape retrieval into
three classes by several criteria, describe the main ideas and techniques for each class,
and detailedly compare their advantages and limits. We also present several relevant 3D
datasets and corresponding evaluation metrics, which are necessary for evaluating
partial retrieval performance. Finally, we discuss possible research directions to address
partial shape retrieval.
2.2 OpenGL
I used OpenGL graphics software to develop my project, OpenGL support on
modern graphics hardware. OpenGL is a cross-platform library for interfacing with
programmable GPUs for the purpose of rendering real-time 3d graphics. Its use is
common in games, CAD, and data visualization applications. It started in the early '90s as
a cross-platform standardization of SGI’s proprietary GL ("Graphics Library") that drove
the graphics hardware in their high-end workstations. A few years
later, GLQuake and 3dfx’s Voodoo graphics accelerators pushed 3d accelerators into the
mainstream, and OpenGL became a standard alongside Microsoft's
proprietary Direct3d library for controlling graphics accelerators in consumer PCs. In
recent years, the Khronos group has taken stewardship of the OpenGL standard, updating
it to support the features of modern programmable GPUs, pushing it into the mobile and
online domains with OpenGL ES and WebGL, and streamlining it in OpenGL 3 by
deprecating the outdated features that cluttered earlier versions of the library.
Another recent development has been the adoption of general purpose GPU
(GPGPU) libraries, including nVidia's CUDA and Khorana’s OpenGL. These libraries
implement dialects of C with added data parallelism features, allowing the GPU to be
used for general computation without having to work within the graphics-oriented
framework of OpenGL. However, these GPGPU frameworks don't replace OpenGL;
since their primary purpose is not graphics programming, they only provide access to a
GPU's computation units, ignoring its graphics-specific hardware. They can, however, act
as accessories to OpenGL.We'll be focusing on using OpenGL for graphics tasks. In
addition to OpenGL, we'll be using other helper libraries: GLU (OpenGL Utility) contains
several routines that use lower level OpenGL commands to perform such tasks as setting
up matrices for specific viewing specifications and projection. GLUT (OpenGL Utility
Toolkit), which provides a cross-platform interface between the window system and
OpenGL. For a fallback, Mesa provides an open-source, cross-platform software OpenGL
implementation that works on Windows and almost all UNIX platforms. Mesa is also the
most common OpenGL implementation on Linux, where it also works with the X server
to interface OpenGL with graphics hardware using "direct rendering interface" (DRI)
drivers.
To install GLUT look for the binary packages on their respective sites. MacOS X
comes with GLUT preinstalled. Most Linux distributions have GLUT available through
their package system, though for GLUT, you may need to enable your distribution's
optional "non-free" package repositories, since its license is not technically open
source[3].We use GLUT library for interacting with any screen windowing systems.
CHAPTER 3
REQUIREMENT ANALYSIS
Some of the primitives that are implemented in our project are referred by using
the books and websites mentioned in bibliography and others by using built in functions
of OpenGL.
3.2.1.2 User Defined Functions
• void bitmap_output( )
• void counting( )
• void disa( )
• void id ( )
• void disp( )
• void init( )
• void id1( )
• void keys( )
• void demo_menu( )
• void demo( )
• int main(int argc,char** argv)
• Programming language-C
• OpenGL
1024x728
CHAPTER 4
IMPLEMENTATION
void myReshape ( ):
This function is used to change the position of an object
void keys ( ):
This function is used to set key to perform desired operations.
void mouse ( ):
This function is used to set mouse to perform desired operations
void demo ( ):
This function is sub menu used to display designer names.
glutInit ():
Initialises GLUT. The argument from main are passed in and can be used by the
application.
glutInitWindowSize():
glutCreateWindow():
Creates the window on the display. The string can be used to label the window.
glutDisplayFunc():
Registers the display function that is executed when the window needs to redrawn.
glutMainLoop():
myinit():
CHAPTER 5
SNAPSHOTS
.
Fig 5.2 Aquarium OpenGL - Right Movement
CONCLUSION
A window with moving fishes, grass, a moving crab, air bubbles, etc., is created using
basic Computer Graphics concepts.
This demonstration is also made interactive by providing a menu in the program. This
animation serves the purpose of computer art.
Other features can be added to achieve,
1. A three-dimensional aquarium
2. Lighting shades can be introduced.
3. Shadow effect.
4. Can provide more options in menu like adding food to the fishes and changing
their speed
FUTURE ENHANCEMENT
As there is nothing in the aquarium that could reduce the temperature when
it has increased so a small air cooler or a fan can be used to decrease the
temperature in case the temperature Increases up.
so that there Will be no issue Of over billing and burden on your pocket. If
in case Of power failure. the aquarium would not stop its work.
In winter, most of the time, the temperature of the water goes down like
if it is in snowfall area then its temperature would go suddenly down and
the sudden variation in the temperature can kill the fish inside the water.
REFERENCES
[1] A.P Godse, Dr. D.A Godse, “Computer Graphics And Visualization”, Technical
Publication Journal, 11 June 2019.
[3] Donald Hearn & Pauline Baker: Computer Graphics with OpenGL Version,3rd / 4th
Edition,
Pearson Education,2011
[4] Edward Angel: Interactive Computer Graphics- A Top Down approach with OpenGL,
5th edition.
Pearson Education, 2008.
[5] M M Raikar & Shreedhara K S Computer Graphics using OpenGL, Cengage publication
APPENDIX
#include <GL/glut.h>
// Check if the fish is out of the screen, then reset its position
if (fishX > 1.0f)
Dept. of CSE, JIT. 2022-2023 18
Aquarium Simulation
fishX = -1.0f;
return 0;
}