SlideShare uma empresa Scribd logo
1 de 9
Baixar para ler 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

Mais conteúdo relacionado

Mais procurados

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
 
Project Super market billing system
Project Super market billing systemProject Super market billing system
Project Super market billing systemVickey Mahant
 
Hand Gesture Recognition Using OpenCV Python
Hand Gesture Recognition Using OpenCV Python Hand Gesture Recognition Using OpenCV Python
Hand Gesture Recognition Using OpenCV Python Arijit Mukherjee
 
Internship on web development
Internship on web developmentInternship on web development
Internship on web developmentRajendra Kandel
 
Graphics Programming OpenGL & GLUT in Code::Blocks
Graphics Programming OpenGL & GLUT in Code::BlocksGraphics Programming OpenGL & GLUT in Code::Blocks
Graphics Programming OpenGL & GLUT in Code::BlocksBudditha Hettige
 
Introduction to computer graphics
Introduction to computer graphicsIntroduction to computer graphics
Introduction to computer graphicsKamal Acharya
 
college website project report
college website project reportcollege website project report
college website project reportMahendra Choudhary
 
The Full Stack Web Development
The Full Stack Web DevelopmentThe Full Stack Web Development
The Full Stack Web DevelopmentSam Dias
 
Android task manager project presentation
Android task manager project presentationAndroid task manager project presentation
Android task manager project presentationAkhilesh Jaiswal
 
A Presentation on Development of a Simple Calculator
A Presentation on Development of a Simple CalculatorA Presentation on Development of a Simple Calculator
A Presentation on Development of a Simple CalculatorTheophilus Omoregbee
 
408372362-Student-Result-management-System-project-report-docx.docx
408372362-Student-Result-management-System-project-report-docx.docx408372362-Student-Result-management-System-project-report-docx.docx
408372362-Student-Result-management-System-project-report-docx.docxsanthoshyadav23
 
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
 
Computer Graphics Project- The Running Train
Computer Graphics Project- The Running TrainComputer Graphics Project- The Running Train
Computer Graphics Project- The Running TrainAmit Kumar
 
5 Pen PC technology seminar report
5 Pen PC technology seminar report5 Pen PC technology seminar report
5 Pen PC technology seminar reportRituraj Singh Panwar
 
Internship Presentation 1 Web Developer
Internship Presentation 1 Web DeveloperInternship Presentation 1 Web Developer
Internship Presentation 1 Web DeveloperHemant Sarthak
 

Mais procurados (20)

bhargav_flowing-fountain
bhargav_flowing-fountainbhargav_flowing-fountain
bhargav_flowing-fountain
 
Java Calculator project
Java Calculator projectJava Calculator project
Java Calculator project
 
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 "
 
Project Super market billing system
Project Super market billing systemProject Super market billing system
Project Super market billing system
 
Hand Gesture Recognition Using OpenCV Python
Hand Gesture Recognition Using OpenCV Python Hand Gesture Recognition Using OpenCV Python
Hand Gesture Recognition Using OpenCV Python
 
Internship on web development
Internship on web developmentInternship on web development
Internship on web development
 
Graphics Programming OpenGL & GLUT in Code::Blocks
Graphics Programming OpenGL & GLUT in Code::BlocksGraphics Programming OpenGL & GLUT in Code::Blocks
Graphics Programming OpenGL & GLUT in Code::Blocks
 
Introduction to computer graphics
Introduction to computer graphicsIntroduction to computer graphics
Introduction to computer graphics
 
college website project report
college website project reportcollege website project report
college website project report
 
The Full Stack Web Development
The Full Stack Web DevelopmentThe Full Stack Web Development
The Full Stack Web Development
 
GOOGLE GLASS
GOOGLE GLASSGOOGLE GLASS
GOOGLE GLASS
 
Android task manager project presentation
Android task manager project presentationAndroid task manager project presentation
Android task manager project presentation
 
A Presentation on Development of a Simple Calculator
A Presentation on Development of a Simple CalculatorA Presentation on Development of a Simple Calculator
A Presentation on Development of a Simple Calculator
 
News portal
News portalNews portal
News portal
 
Java project-presentation
Java project-presentationJava project-presentation
Java project-presentation
 
408372362-Student-Result-management-System-project-report-docx.docx
408372362-Student-Result-management-System-project-report-docx.docx408372362-Student-Result-management-System-project-report-docx.docx
408372362-Student-Result-management-System-project-report-docx.docx
 
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
 
Computer Graphics Project- The Running Train
Computer Graphics Project- The Running TrainComputer Graphics Project- The Running Train
Computer Graphics Project- The Running Train
 
5 Pen PC technology seminar report
5 Pen PC technology seminar report5 Pen PC technology seminar report
5 Pen PC technology seminar report
 
Internship Presentation 1 Web Developer
Internship Presentation 1 Web DeveloperInternship Presentation 1 Web Developer
Internship Presentation 1 Web Developer
 

Semelhante a 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
 
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
 
Lab Practices and Works Documentation / Report on Computer Graphics
Lab Practices and Works Documentation / Report on Computer GraphicsLab Practices and Works Documentation / Report on Computer Graphics
Lab Practices and Works Documentation / Report on Computer GraphicsRup Chowdhury
 
OpenGL Introduction.
OpenGL Introduction.OpenGL Introduction.
OpenGL Introduction.Girish Ghate
 
GRAPHICS AND OPENGL.pptx
GRAPHICS AND OPENGL.pptxGRAPHICS AND OPENGL.pptx
GRAPHICS AND OPENGL.pptxOMNATHSINGH1
 
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
 
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
 

Semelhante a 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
 
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
 
Lab Practices and Works Documentation / Report on Computer Graphics
Lab Practices and Works Documentation / Report on Computer GraphicsLab Practices and Works Documentation / Report on Computer Graphics
Lab Practices and Works Documentation / Report on Computer Graphics
 
OpenGL Introduction.
OpenGL Introduction.OpenGL Introduction.
OpenGL Introduction.
 
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
 
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
 
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
 

Mais de 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
 

Mais de 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
 

Último

08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 

Último (20)

08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 

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