SlideShare a Scribd company logo
1 of 9
Download to read offline
Synopsis | Sinking Ship
Computer Graphics 1 | P a g e
1. INTRODUCTION
This synopsis contains implementation of ‘SINKING SHIP’ using a set of OpenGL functions.
The project consists of three scenes. The first scene just shows the ship, which is stable and not
moving. The second scene will be of the moving ship. In addition, the third scene will be of the
ship that is being hit onto an iceberg and sink in the sea. User interaction is provided by enabling
the user to move the ship in forward and backward direction using alphabetical keys or the special
keys. User can stop the ship and even change the mode to day or night. Additionally, the user can
access these functions from the menu by right clicking the mouse. The objects are drawn using
GLUT functions.
1.1 Computer Graphics
Computer graphics is one of the most exciting and rapidly growing computer fields. It is also an
extremely effective medium for communication between man and computer; a human being can
understand the information content of a displayed diagram or perspective view much faster than
he can understand a table of numbers or text containing the same information. Thus computer
graphics is being used more extensively. There is a lot of development in hardware and software
required to generate images, and nowadays the Cost of hardware and software is dropping rapidly.
Due to this, interactive computer graphics is becoming available to more and more people.
Computer graphics started with the display of data on hardcopy plotters and cathode ray tube
(CRT) screens soon after the introduction of computers themselves. It has grown to include the
creation, storage and manipulation of models and manipulation of models and images of objects.
These models come from a diverse and expanding set of fields, and include physical,
mathematical, engineering, architectural, and even conceptual structures, natural phenomena, and
so on.
Figure 1.1 Computer Graphics System
Synopsis | Sinking Ship
Computer Graphics 2 | P a g e
Computer graphics today is largely interactive. The user controls the contents, structure and
appearance of objects and their displayed images by using input devices, such as a keyboard,
mouse, or touch sensitive panel on the screen. The handling of such devices is included in the
study of computer graphics, because of the close relationship between the input devices and the
display.
1.2 OpenGL
OpenGL (open graphics library) is a standard specification defining a cross language across
platform API for writing applications that produce 2D and 3D computer graphics. 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.
OpenGL serves two main purpose:
 To hide the complexities of interfacing with different 3D accelerators, by presenting
programmer with a single, uniform API
 To hide the differing capabilities of hardware platforms, by requiring that all
Implementations support the full OpenGL, feature set.
OpenGL is an application program interface (API) offering various functions to implement
primitives, models and images. This offers functions to create and manipulate render lighting,
coloring, viewing the models. OpenGL offers different coordinate system and frames. OpenGL
offers translation, rotation and scaling of objects.
Most of our applications will be designed to access OpenGL directly through functions in three
libraries. They are:
 Main GL: Library has names that begin with the letter gland are stored in a library usually
referred to as GL.
 OpenGL Utility Library (GLU): This library uses only GL functions but contains 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.
 OpenGL Utility Toolkit(GLUT): This provides the minimum functionality that should be
accepted in any modern windowing system. For the X window system, this library is called
GLX, for windows, it is WGL or Wiggle. And for Macintosh, it is AGL. Rather than using
different library for each system, we use a readily available library called GLUT.
Synopsis | Sinking Ship
Computer Graphics 3 | P a g e
Figure 1.2 OpenGL Graphics Architecture
OpenGL is designed as a streamlined, hardware-independent interface to be implemented on many
different hardware platforms. To achieve these qualities, no commands for performing windowing
tasks or obtaining user input are included in OpenGL. Instead, you must work through whatever
windowing system controls the particular hardware you're using. Similarly, OpenGL doesn't
provide high-level commands for describing models of three-dimensional objects. Such
commands might allow you to specify relatively complicated shapes such as automobiles, parts of
the body, airplanes, or molecules.
2. OpenGL SYNTAX
 glVertex*():-The glVertex function commands are used withinglBegin/glEndpairs to
specify point, line, and polygon vertices. The current color, normal, texture coordinates,
and fog coordinate are associated with the vertex when glVertex is called. When only x
and y are specified, z defaults to 0 and w defaults to 1.
 glColor*( ):-It sets a few four-valued RGBA color. glColor has two major variants:
glColor3 and glColor4. glColor3 variants specify new red, green and blue values explicitly
and set the current alpha value to 1.0 implicitly. glColor4 variants specify all four color
components explicitly.
 gluOrtho2D(GLdouble left, GLdouble right, GLdouble bottom,GLdouble top):-
which defines a two-dimensional orthographic viewing region. This is equivalent to calling
glOrtho with near =-1 and far =1.
Synopsis | Sinking Ship
Computer Graphics 4 | P a g e
 glClear():- glClear sets the bitplane area of the window to values previously selected by
glClearColor, glClearIndex, glClearDepth, glClearStencil and glClearAccum. Multiple
color buffers can be cleared simultaneously by selecting more than one buffer at a time.
 glClearColor():- Specifies the red, green, blue, and alpha values used by glClear to clear
the color buffers. Values specified by glClearColor are clamped to the range 0 1.
 glLoadIdentity( ):-The current matrix with the identity matrix. It is used to replace the
current matrix with the identity matrix.
 glMatrixMode(mode):-Sets the current matrix mode, mode can be GL_MODELVIEW,
GL_PROJECTION or GL_TEXTURE.
 void glutInit(int *argc, char**argv):-Initializes GLUT, the arguments from main are
passed in and can be used by the application.
 void glutInitDisplayMode(unsigned int mode):-Requests a display with the
properties in mode. The value of mode is determined by the logical OR of options
including the color model and buffering.
 void glutInitWindowSize(int width, int height):- Specifies the initial position of the
top-left corner of the window in pixels.
 int glutCreateWindow(char *title):-A window on the display. The string title can be
used to label the window. The return value provides references to the window that can be
used when there are multiple windows.
 voidglutMouseFunc(void *f(int button, int state, int x, int y):-Register the mouse
callback function f. The callback function returns the button,the state of button after the
event and the position of the mouse relative to the top-left corner of the window.
 void glutKeyboardFunc(void(*func) (void)):-This function is called every time when
you press enter key to resume the game or when you press ‘b’ or ‘B’ key to go back to the
initial screen or when you press Esc key to exit from the application.
Synopsis | Sinking Ship
Computer Graphics 5 | P a g e
 void glutDisplayFunc(void (*func) (void)):-Register the display function func that is
executed when the window needs to be redrawn.
 void glutSpecialFunc(void(*func)( void)):-This function is called when you press the
special keys in the keyboard like arrow keys, function keys etc. In our program, the funcis
invoked when the up arrow or down arrow key is pressed for selecting the options in the
main menu and when the left or right arrow key is pressed for moving the object(car)
accordingly.
 glutPostReDisplay():- Which requests that the display callback be executed after the
current callback returns.
 void MouseFunc(void (*func) void)):- This function is invoked when mouse keys are
pressed. This function is used as an alternative to the previous function i.e, it is used to
move the object(car) to right or left in our program by clicking left and right button
respectively.
 void glutMainLoop( ):- Cause the program to enter an event processing loop. It should
be the last statement in main function.
3. SYSTEM REQUIREMENTS SPECIFICATION
3.1 HARDWARE REQUIREMENTS
 RAM: 2GB and higher
 Hard Disk: 40GB and higher
 Keyboard: QWERTY keyboard
 Mouse: 2 or 3 Button Mouse
 Monitor: 1024 x 768 display Resolution
3.2 SOFTWARE REQUIREMENTS
 Programming Language: C/C++ using OpenGL
 Operating System: Linux Operating System
 Compiler – GCC compiler
 Graphics library: GL/glut.h
 OpenGL 2.0
Synopsis | Sinking Ship
Computer Graphics 6 | P a g e
4. USER INTERACTION
Using Alphabetical Keys:
‘F’ or ‘f’: Move Ship Forward
‘R’ or ‘r’: Move Ship Backward
‘S’ or ‘s’: Stop the Ship
‘N’ or ‘n’: Shift to Night Mode
‘D’ or ‘d’: Shift to Day Mode
‘Q’ or ‘q’: Quit
Using Special Keys:
LEFT BUTTON: Move Ship Backward
RIGHT BUTTON: Move Ship Forward
DOWN BUTTON: Stop the Ship
5. SNAPSHOTS
Figure 4.1 - Ship is Stable
Synopsis | Sinking Ship
Computer Graphics 7 | P a g e
Figure 4.2 – Ship is moving
Figure 4.3 – Ship and the Iceberg
Synopsis | Sinking Ship
Computer Graphics 8 | P a g e
Figure 4.4 – Ship is collided with the Iceberg
Figure 4.5 – Ship has sunk and the rocket is flying
Synopsis | Sinking Ship
Computer Graphics 9 | P a g e
6. CONCLUSION
We have attempted to design and implement “Sinking Ship”. OpenGL supports enormous
flexibility in the design and the use of OpenGL graphics programs. The presence of many built-
in classes methods take care of much functionality and reduce the job of coding as well as
makes the implementation simpler. We have implemented the project making it user-friendly
and error free as possible. We regret any errors that may have inadvertently crept in.
7. REFERENCES
http://lazyfoo.net/tutorials/OpenGL/02_matrices_and_coloring_polygons/index.php
http://csciwww.etsu.edu/barrettm/4157/OpenGL%20Functions.htm
https://www.glprogramming.com/red/chapter01.html
https://www2.cs.duke.edu/courses/cps124/fall01/resources/ogl_ref.pdf

More Related Content

What's hot

Airline Reservation System
Airline Reservation SystemAirline Reservation System
Airline Reservation SystemArohi Khandelwal
 
Lecture 6 introduction to open gl and glut
Lecture 6   introduction to open gl and glutLecture 6   introduction to open gl and glut
Lecture 6 introduction to open gl and glutsimpleok
 
Airline Reservation System Documentation
Airline Reservation System DocumentationAirline Reservation System Documentation
Airline Reservation System DocumentationSanjana Agarwal
 
Restaurent management system
Restaurent management systemRestaurent management system
Restaurent management systemSmit Patel
 
Project for Student Result System
Project for Student Result SystemProject for Student Result System
Project for Student Result SystemKuMaR AnAnD
 
Computer Graphics Project- The Running Train
Computer Graphics Project- The Running TrainComputer Graphics Project- The Running Train
Computer Graphics Project- The Running TrainAmit Kumar
 
Project loon report
Project loon  report Project loon  report
Project loon report sneha tatode
 
Airline Reservation system(project report of six week training)-ppt
Airline Reservation system(project report of six week training)-pptAirline Reservation system(project report of six week training)-ppt
Airline Reservation system(project report of six week training)-pptPunjab technical University
 
Time Table Management System
Time Table Management SystemTime Table Management System
Time Table Management SystemMuhammad Zeeshan
 
Time Table Management System Software Report
Time Table Management System Software ReportTime Table Management System Software Report
Time Table Management System Software ReportAditya Jain
 
Mini Project on Data Encryption & Decryption in JAVA
Mini Project on Data Encryption & Decryption in JAVAMini Project on Data Encryption & Decryption in JAVA
Mini Project on Data Encryption & Decryption in JAVAchovatiyabhautik
 
project on snake game in c language
project on snake game in c languageproject on snake game in c language
project on snake game in c languageAshutosh Kumar
 
OpenGL Introduction.
OpenGL Introduction.OpenGL Introduction.
OpenGL Introduction.Girish Ghate
 
CSE Final Year Project Presentation on Android Application
CSE Final Year Project Presentation on Android ApplicationCSE Final Year Project Presentation on Android Application
CSE Final Year Project Presentation on Android ApplicationAhammad Karim
 
Passport Automation System
Passport Automation SystemPassport Automation System
Passport Automation SystemMegha Sahu
 
Online Bus Reservatiom System
Online Bus Reservatiom SystemOnline Bus Reservatiom System
Online Bus Reservatiom SystemNikhil Vyas
 
smart note taker
smart note takersmart note taker
smart note takerveena jl
 

What's hot (20)

Airline Reservation System
Airline Reservation SystemAirline Reservation System
Airline Reservation System
 
Lecture 6 introduction to open gl and glut
Lecture 6   introduction to open gl and glutLecture 6   introduction to open gl and glut
Lecture 6 introduction to open gl and glut
 
Airline Reservation System Documentation
Airline Reservation System DocumentationAirline Reservation System Documentation
Airline Reservation System Documentation
 
Restaurent management system
Restaurent management systemRestaurent management system
Restaurent management system
 
Project for Student Result System
Project for Student Result SystemProject for Student Result System
Project for Student Result System
 
Computer Graphics Project- The Running Train
Computer Graphics Project- The Running TrainComputer Graphics Project- The Running Train
Computer Graphics Project- The Running Train
 
Project loon report
Project loon  report Project loon  report
Project loon report
 
Airline Reservation system(project report of six week training)-ppt
Airline Reservation system(project report of six week training)-pptAirline Reservation system(project report of six week training)-ppt
Airline Reservation system(project report of six week training)-ppt
 
snake game
snake gamesnake game
snake game
 
Time Table Management System
Time Table Management SystemTime Table Management System
Time Table Management System
 
Mini Project PPT
Mini Project PPTMini Project PPT
Mini Project PPT
 
Time Table Management System Software Report
Time Table Management System Software ReportTime Table Management System Software Report
Time Table Management System Software Report
 
Mini Project on Data Encryption & Decryption in JAVA
Mini Project on Data Encryption & Decryption in JAVAMini Project on Data Encryption & Decryption in JAVA
Mini Project on Data Encryption & Decryption in JAVA
 
project on snake game in c language
project on snake game in c languageproject on snake game in c language
project on snake game in c language
 
OpenGL Introduction.
OpenGL Introduction.OpenGL Introduction.
OpenGL Introduction.
 
CSE Final Year Project Presentation on Android Application
CSE Final Year Project Presentation on Android ApplicationCSE Final Year Project Presentation on Android Application
CSE Final Year Project Presentation on Android Application
 
Passport Automation System
Passport Automation SystemPassport Automation System
Passport Automation System
 
Space mouse[1]
Space mouse[1]Space mouse[1]
Space mouse[1]
 
Online Bus Reservatiom System
Online Bus Reservatiom SystemOnline Bus Reservatiom System
Online Bus Reservatiom System
 
smart note taker
smart note takersmart note taker
smart note taker
 

Similar to Computer Graphics Project Report on Sinking Ship using OpenGL

openGL basics for sample program (1).ppt
openGL basics for sample program (1).pptopenGL basics for sample program (1).ppt
openGL basics for sample program (1).pptHIMANKMISHRA2
 
openGL basics for sample program.ppt
openGL basics for sample program.pptopenGL basics for sample program.ppt
openGL basics for sample program.pptHIMANKMISHRA2
 
Mini Project final report on " LEAKY BUCKET ALGORITHM "
Mini Project final report on " LEAKY BUCKET ALGORITHM "Mini Project final report on " LEAKY BUCKET ALGORITHM "
Mini Project final report on " LEAKY BUCKET ALGORITHM "Nikhil Jain
 
Computer Graphics with OpenGL presentation Slides.pptx
Computer Graphics with OpenGL presentation Slides.pptxComputer Graphics with OpenGL presentation Slides.pptx
Computer Graphics with OpenGL presentation Slides.pptxAnandM62785
 
OpenGL ES based UI Development on TI Platforms
OpenGL ES based UI Development on TI PlatformsOpenGL ES based UI Development on TI Platforms
OpenGL ES based UI Development on TI PlatformsPrabindh Sundareson
 
3 CG_U1_P2_PPT_3 OpenGL.pptx
3 CG_U1_P2_PPT_3 OpenGL.pptx3 CG_U1_P2_PPT_3 OpenGL.pptx
3 CG_U1_P2_PPT_3 OpenGL.pptxssuser255bf1
 
GRAPHICS AND OPENGL.pptx
GRAPHICS AND OPENGL.pptxGRAPHICS AND OPENGL.pptx
GRAPHICS AND OPENGL.pptxOMNATHSINGH1
 
OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...
OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...
OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...ICS
 
Ball Collecting game report
Ball Collecting game report Ball Collecting game report
Ball Collecting game report Dileep Maurya
 
VisionizeBeforeVisulaize_IEVC_Final
VisionizeBeforeVisulaize_IEVC_FinalVisionizeBeforeVisulaize_IEVC_Final
VisionizeBeforeVisulaize_IEVC_FinalMasatsugu HASHIMOTO
 
1 introduction computer graphics
1 introduction computer graphics1 introduction computer graphics
1 introduction computer graphicscairo university
 

Similar to Computer Graphics Project Report on Sinking Ship using OpenGL (20)

openGL basics for sample program (1).ppt
openGL basics for sample program (1).pptopenGL basics for sample program (1).ppt
openGL basics for sample program (1).ppt
 
openGL basics for sample program.ppt
openGL basics for sample program.pptopenGL basics for sample program.ppt
openGL basics for sample program.ppt
 
Mini Project final report on " LEAKY BUCKET ALGORITHM "
Mini Project final report on " LEAKY BUCKET ALGORITHM "Mini Project final report on " LEAKY BUCKET ALGORITHM "
Mini Project final report on " LEAKY BUCKET ALGORITHM "
 
Open gl
Open glOpen gl
Open gl
 
18csl67 vtu lab manual
18csl67 vtu lab manual18csl67 vtu lab manual
18csl67 vtu lab manual
 
Computer Graphics with OpenGL presentation Slides.pptx
Computer Graphics with OpenGL presentation Slides.pptxComputer Graphics with OpenGL presentation Slides.pptx
Computer Graphics with OpenGL presentation Slides.pptx
 
OpenGL ES based UI Development on TI Platforms
OpenGL ES based UI Development on TI PlatformsOpenGL ES based UI Development on TI Platforms
OpenGL ES based UI Development on TI Platforms
 
3 CG_U1_P2_PPT_3 OpenGL.pptx
3 CG_U1_P2_PPT_3 OpenGL.pptx3 CG_U1_P2_PPT_3 OpenGL.pptx
3 CG_U1_P2_PPT_3 OpenGL.pptx
 
Hill ch2ed3
Hill ch2ed3Hill ch2ed3
Hill ch2ed3
 
Open gles
Open glesOpen gles
Open gles
 
Opengl basics
Opengl basicsOpengl basics
Opengl basics
 
GRAPHICS AND OPENGL.pptx
GRAPHICS AND OPENGL.pptxGRAPHICS AND OPENGL.pptx
GRAPHICS AND OPENGL.pptx
 
Opengl (1)
Opengl (1)Opengl (1)
Opengl (1)
 
Arkanoid Game
Arkanoid GameArkanoid Game
Arkanoid Game
 
Introduction to OpenGL.ppt
Introduction to OpenGL.pptIntroduction to OpenGL.ppt
Introduction to OpenGL.ppt
 
OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...
OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...
OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...
 
Ball Collecting game report
Ball Collecting game report Ball Collecting game report
Ball Collecting game report
 
OpenGL Introduction
OpenGL IntroductionOpenGL Introduction
OpenGL Introduction
 
VisionizeBeforeVisulaize_IEVC_Final
VisionizeBeforeVisulaize_IEVC_FinalVisionizeBeforeVisulaize_IEVC_Final
VisionizeBeforeVisulaize_IEVC_Final
 
1 introduction computer graphics
1 introduction computer graphics1 introduction computer graphics
1 introduction computer graphics
 

More from Sharath Raj

Eye Tracking Based Human - Computer Interaction
Eye Tracking Based Human - Computer InteractionEye Tracking Based Human - Computer Interaction
Eye Tracking Based Human - Computer InteractionSharath Raj
 
Basic Computer Knowledge in Kannada
Basic Computer Knowledge in KannadaBasic Computer Knowledge in Kannada
Basic Computer Knowledge in KannadaSharath Raj
 
Substance abuse and addiction
Substance abuse and addictionSubstance abuse and addiction
Substance abuse and addictionSharath Raj
 
Digital data storage in DNA
Digital data storage in DNADigital data storage in DNA
Digital data storage in DNASharath Raj
 
Artificial Intelligence
Artificial IntelligenceArtificial Intelligence
Artificial IntelligenceSharath Raj
 
Final Year Project BCA Presentation on Pic-O-Stica
Final Year Project BCA Presentation on Pic-O-SticaFinal Year Project BCA Presentation on Pic-O-Stica
Final Year Project BCA Presentation on Pic-O-SticaSharath Raj
 
Artificial inteligence
Artificial inteligenceArtificial inteligence
Artificial inteligenceSharath Raj
 
Cyber crime and security
Cyber crime and securityCyber crime and security
Cyber crime and securitySharath Raj
 

More from Sharath Raj (8)

Eye Tracking Based Human - Computer Interaction
Eye Tracking Based Human - Computer InteractionEye Tracking Based Human - Computer Interaction
Eye Tracking Based Human - Computer Interaction
 
Basic Computer Knowledge in Kannada
Basic Computer Knowledge in KannadaBasic Computer Knowledge in Kannada
Basic Computer Knowledge in Kannada
 
Substance abuse and addiction
Substance abuse and addictionSubstance abuse and addiction
Substance abuse and addiction
 
Digital data storage in DNA
Digital data storage in DNADigital data storage in DNA
Digital data storage in DNA
 
Artificial Intelligence
Artificial IntelligenceArtificial Intelligence
Artificial Intelligence
 
Final Year Project BCA Presentation on Pic-O-Stica
Final Year Project BCA Presentation on Pic-O-SticaFinal Year Project BCA Presentation on Pic-O-Stica
Final Year Project BCA Presentation on Pic-O-Stica
 
Artificial inteligence
Artificial inteligenceArtificial inteligence
Artificial inteligence
 
Cyber crime and security
Cyber crime and securityCyber crime and security
Cyber crime and security
 

Recently uploaded

Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 

Recently uploaded (20)

Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 

Computer Graphics Project Report on Sinking Ship using OpenGL

  • 1. Synopsis | Sinking Ship Computer Graphics 1 | P a g e 1. INTRODUCTION This synopsis contains implementation of ‘SINKING SHIP’ using a set of OpenGL functions. The project consists of three scenes. The first scene just shows the ship, which is stable and not moving. The second scene will be of the moving ship. In addition, the third scene will be of the ship that is being hit onto an iceberg and sink in the sea. User interaction is provided by enabling the user to move the ship in forward and backward direction using alphabetical keys or the special keys. User can stop the ship and even change the mode to day or night. Additionally, the user can access these functions from the menu by right clicking the mouse. The objects are drawn using GLUT functions. 1.1 Computer Graphics Computer graphics is one of the most exciting and rapidly growing computer fields. It is also an extremely effective medium for communication between man and computer; a human being can understand the information content of a displayed diagram or perspective view much faster than he can understand a table of numbers or text containing the same information. Thus computer graphics is being used more extensively. There is a lot of development in hardware and software required to generate images, and nowadays the Cost of hardware and software is dropping rapidly. Due to this, interactive computer graphics is becoming available to more and more people. Computer graphics started with the display of data on hardcopy plotters and cathode ray tube (CRT) screens soon after the introduction of computers themselves. It has grown to include the creation, storage and manipulation of models and manipulation of models and images of objects. These models come from a diverse and expanding set of fields, and include physical, mathematical, engineering, architectural, and even conceptual structures, natural phenomena, and so on. Figure 1.1 Computer Graphics System
  • 2. Synopsis | Sinking Ship Computer Graphics 2 | P a g e Computer graphics today is largely interactive. The user controls the contents, structure and appearance of objects and their displayed images by using input devices, such as a keyboard, mouse, or touch sensitive panel on the screen. The handling of such devices is included in the study of computer graphics, because of the close relationship between the input devices and the display. 1.2 OpenGL OpenGL (open graphics library) is a standard specification defining a cross language across platform API for writing applications that produce 2D and 3D computer graphics. 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. OpenGL serves two main purpose:  To hide the complexities of interfacing with different 3D accelerators, by presenting programmer with a single, uniform API  To hide the differing capabilities of hardware platforms, by requiring that all Implementations support the full OpenGL, feature set. OpenGL is an application program interface (API) offering various functions to implement primitives, models and images. This offers functions to create and manipulate render lighting, coloring, viewing the models. OpenGL offers different coordinate system and frames. OpenGL offers translation, rotation and scaling of objects. Most of our applications will be designed to access OpenGL directly through functions in three libraries. They are:  Main GL: Library has names that begin with the letter gland are stored in a library usually referred to as GL.  OpenGL Utility Library (GLU): This library uses only GL functions but contains 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.  OpenGL Utility Toolkit(GLUT): This provides the minimum functionality that should be accepted in any modern windowing system. For the X window system, this library is called GLX, for windows, it is WGL or Wiggle. And for Macintosh, it is AGL. Rather than using different library for each system, we use a readily available library called GLUT.
  • 3. Synopsis | Sinking Ship Computer Graphics 3 | P a g e Figure 1.2 OpenGL Graphics Architecture OpenGL is designed as a streamlined, hardware-independent interface to be implemented on many different hardware platforms. To achieve these qualities, no commands for performing windowing tasks or obtaining user input are included in OpenGL. Instead, you must work through whatever windowing system controls the particular hardware you're using. Similarly, OpenGL doesn't provide high-level commands for describing models of three-dimensional objects. Such commands might allow you to specify relatively complicated shapes such as automobiles, parts of the body, airplanes, or molecules. 2. OpenGL SYNTAX  glVertex*():-The glVertex function commands are used withinglBegin/glEndpairs to specify point, line, and polygon vertices. The current color, normal, texture coordinates, and fog coordinate are associated with the vertex when glVertex is called. When only x and y are specified, z defaults to 0 and w defaults to 1.  glColor*( ):-It sets a few four-valued RGBA color. glColor has two major variants: glColor3 and glColor4. glColor3 variants specify new red, green and blue values explicitly and set the current alpha value to 1.0 implicitly. glColor4 variants specify all four color components explicitly.  gluOrtho2D(GLdouble left, GLdouble right, GLdouble bottom,GLdouble top):- which defines a two-dimensional orthographic viewing region. This is equivalent to calling glOrtho with near =-1 and far =1.
  • 4. Synopsis | Sinking Ship Computer Graphics 4 | P a g e  glClear():- glClear sets the bitplane area of the window to values previously selected by glClearColor, glClearIndex, glClearDepth, glClearStencil and glClearAccum. Multiple color buffers can be cleared simultaneously by selecting more than one buffer at a time.  glClearColor():- Specifies the red, green, blue, and alpha values used by glClear to clear the color buffers. Values specified by glClearColor are clamped to the range 0 1.  glLoadIdentity( ):-The current matrix with the identity matrix. It is used to replace the current matrix with the identity matrix.  glMatrixMode(mode):-Sets the current matrix mode, mode can be GL_MODELVIEW, GL_PROJECTION or GL_TEXTURE.  void glutInit(int *argc, char**argv):-Initializes GLUT, the arguments from main are passed in and can be used by the application.  void glutInitDisplayMode(unsigned int mode):-Requests a display with the properties in mode. The value of mode is determined by the logical OR of options including the color model and buffering.  void glutInitWindowSize(int width, int height):- Specifies the initial position of the top-left corner of the window in pixels.  int glutCreateWindow(char *title):-A window on the display. The string title can be used to label the window. The return value provides references to the window that can be used when there are multiple windows.  voidglutMouseFunc(void *f(int button, int state, int x, int y):-Register the mouse callback function f. The callback function returns the button,the state of button after the event and the position of the mouse relative to the top-left corner of the window.  void glutKeyboardFunc(void(*func) (void)):-This function is called every time when you press enter key to resume the game or when you press ‘b’ or ‘B’ key to go back to the initial screen or when you press Esc key to exit from the application.
  • 5. Synopsis | Sinking Ship Computer Graphics 5 | P a g e  void glutDisplayFunc(void (*func) (void)):-Register the display function func that is executed when the window needs to be redrawn.  void glutSpecialFunc(void(*func)( void)):-This function is called when you press the special keys in the keyboard like arrow keys, function keys etc. In our program, the funcis invoked when the up arrow or down arrow key is pressed for selecting the options in the main menu and when the left or right arrow key is pressed for moving the object(car) accordingly.  glutPostReDisplay():- Which requests that the display callback be executed after the current callback returns.  void MouseFunc(void (*func) void)):- This function is invoked when mouse keys are pressed. This function is used as an alternative to the previous function i.e, it is used to move the object(car) to right or left in our program by clicking left and right button respectively.  void glutMainLoop( ):- Cause the program to enter an event processing loop. It should be the last statement in main function. 3. SYSTEM REQUIREMENTS SPECIFICATION 3.1 HARDWARE REQUIREMENTS  RAM: 2GB and higher  Hard Disk: 40GB and higher  Keyboard: QWERTY keyboard  Mouse: 2 or 3 Button Mouse  Monitor: 1024 x 768 display Resolution 3.2 SOFTWARE REQUIREMENTS  Programming Language: C/C++ using OpenGL  Operating System: Linux Operating System  Compiler – GCC compiler  Graphics library: GL/glut.h  OpenGL 2.0
  • 6. Synopsis | Sinking Ship Computer Graphics 6 | P a g e 4. USER INTERACTION Using Alphabetical Keys: ‘F’ or ‘f’: Move Ship Forward ‘R’ or ‘r’: Move Ship Backward ‘S’ or ‘s’: Stop the Ship ‘N’ or ‘n’: Shift to Night Mode ‘D’ or ‘d’: Shift to Day Mode ‘Q’ or ‘q’: Quit Using Special Keys: LEFT BUTTON: Move Ship Backward RIGHT BUTTON: Move Ship Forward DOWN BUTTON: Stop the Ship 5. SNAPSHOTS Figure 4.1 - Ship is Stable
  • 7. Synopsis | Sinking Ship Computer Graphics 7 | P a g e Figure 4.2 – Ship is moving Figure 4.3 – Ship and the Iceberg
  • 8. Synopsis | Sinking Ship Computer Graphics 8 | P a g e Figure 4.4 – Ship is collided with the Iceberg Figure 4.5 – Ship has sunk and the rocket is flying
  • 9. Synopsis | Sinking Ship Computer Graphics 9 | P a g e 6. CONCLUSION We have attempted to design and implement “Sinking Ship”. OpenGL supports enormous flexibility in the design and the use of OpenGL graphics programs. The presence of many built- in classes methods take care of much functionality and reduce the job of coding as well as makes the implementation simpler. We have implemented the project making it user-friendly and error free as possible. We regret any errors that may have inadvertently crept in. 7. REFERENCES http://lazyfoo.net/tutorials/OpenGL/02_matrices_and_coloring_polygons/index.php http://csciwww.etsu.edu/barrettm/4157/OpenGL%20Functions.htm https://www.glprogramming.com/red/chapter01.html https://www2.cs.duke.edu/courses/cps124/fall01/resources/ogl_ref.pdf