"Rocket Launch": Visvesvaraya Technological University

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 29

VISVESVARAYA TECHNOLOGICAL UNIVERSITY

Jnana Sangama, Belagavi – 590 018, Karnataka, India.

A MINI PROJECT ON

“ROCKET LAUNCH”
A Mini Project submitted in partial fulfilment of the requirement for
the degree of

BACHELOR OF ENGINEERING
In
COMPUTER SCIENCE & ENGINEERING

Submitted by
FARHAAN PASHA 1RG18CS018
BASAVARAJ 1RG17CS068
Under the Guidance of
Mrs. Geetha Pawar
Asst. Prof. Dept. of CSE
RGIT, Bangalore – 36

Department of Computer Science & Engineering


RAJIV GANDHI INSTITUTE OF TECHNOLOGY
Cholanagar, R.T. Nagar Post, Bangalore – 560 036
2019-2020
RAJIV GANDHI INSTITUTE OF TECHNOLOGY
(Affiliated to Visveshwaraya Technological University)
Cholanagar, R.T. Nagar Post, Bangalore – 560 032

Department of Computer Science Engineering

This is to certify the Mini Project entitled “ROCKET LAUNCH” is a


bonafide work carried out by FARHAAN PASHA (1RG18CS018) and
BASAVARAJ (1RG18CS063) in partial fulfilment for the award of
Bachelor of Engineering in computer Science Engineering, during the
year 2020-2021. It is certified that all corrections/suggestions given for the
internal assessment have been incorporated in the report. This Mini Project
has been approved as it satisfies the academic requirements in respect of
the seminar work.

____________________ ___________________
Signature of Guide Signature of HOD
Mrs. Geetha Pawar Mrs. Arudra A
Asst. Professor, Associate Prof. & HOD
Dept. of CSE Dept. of CSE
RGIT, Bangalore RGIT, Bangalore

EXTERNAL VIVA
Name of the Examiners Signature with Date
1.

2.
VISVESVARAYA TECHNOLOGY UNIVERSITY
JNANA SANGAMA, BELAGAVI – 590 018

RAJIV GANDHI INSTITUTE OF TECHNOLOGY

DEPARTMENT OF COMPUTER SCIENCE &


ENGINEERING

DECLARATION

We hereby declare that the Mini Project work entitled


“ROCKET LAUNCH” submitted to the Visvesvaraya
Technological University, Belagavi during the academic
year 2020-2021, is a record of an original work done by us
under the guidance of Mrs. Geetha Pawar, Assistant
Professor,Department of Compute Science and
Engineering, Rajiv Gandhi Institute of Technology,
Bangalore and this project work is submitted in the partial
fulfilment of Requirements for the award of the degree of
Bachelor of Engineering in Computer Science & Engineering.
The results embodied in this thesis have not been submitted
to any other University or Institute for award if any degree
or diploma.

FARHAAN PASHA 1RG18CS018

BASAVARAJ 1RG18CS068
ACKNOWLEDGEMENT

We take this opportunity to express our sincere gratitude and respect to


the Rajiv Gandhi Institute of Technology, Bangalore for providing us
an opportunity to carry out our project work.

We express our sincere regards and thanks to Dr. NAGARAJ A M,

Principal, RGIT, Bangalore and Mrs. Arudra A, Associate Prof. &

HOD of Department of Computer Science & Engineering, RGIT,


Bangalore, for their encouragement and support throughout the project.

With profound sense of gratitude, we acknowledge the guidance and


support extended by Mrs. Geetha Pawar, Asst. Prof and Miss. Rajini
Kodagali, Asst. Prof, Department of Computer Science &
Engineering, RGIT, Bangalore. Her incessant encouragement and
valuable technical support have been of immense help in realizing this
project. Herr guidance gave us the environment to enhance our
knowledge, skills and to reach the pinnacle with sheer determination,
dedication and hard work.

We also extend our thanks to the entire faculty of the Department of


CSE, RGIT, Bangalore, who have encouraged us throughout the course of
Bachelor Degree

FARHAAN PASHA 1RG18CS018

BASAVARAJ 1RG18CS068
ABSTRACT

This project is about the creation of moving primitive 2D & 3D Objects.

We are implementing it using different openGL libraries (PyopenGL)

combining them together in a required manner to achieve the objective.

Our objective to understand the impact of light source, which can be

observed on the real 3D environment which we create. By this we will

understand the reflection, shadow and surface smoothness on the created

primitive object.
Table of Contents
Certificate
Declaration
Acknowledgement
Abstract
CHAPTERS TITLE PAGE NO
1. INTRODUCTION
1.1 Computer Graphics 1
1.2 Application of computer graphics 1
1.2.1 Display of information 1
1.2.2 Design 2
1.2.3 Simulation & Animation 2
1.2.4 User Interface 2
1.3 Introduction to OpenGL 3
1.4 Pygame 3
1.5 Block Diagram of OpenGL 4

2. SYSTEM ANALYSIS
2.1 Existing System 5
2.2 Proposed System 5
2.3 Scope & Aim of Project 5

3. REQUIREMENT SPECIFICATION
3.1 User Requirement 6
3.2 Software Requirement 6
3.3 Hardware Requirement 6

4. IMPLEMENTATION
4.1 Built-in Function 7
4.2 Header Files/imports 11
4.3 Variable Declaration 11
4.4 Function Declaration 11

5. SCREENSHOTS 16
6. CONCLUSION
7. BIBLIOGRAPHY
ROCKET LAUNCH 2020-2021

CHAPTER 1

INTRODUCTION

1.1 Computer Graphics

Computer graphics is concerned with all aspects of producing pictures or images using a
computer. The field began humbly 50 years ago, with the display of few lines on a cathode-ray
tube (CRT). Now, we generate images with the computer that indistinguishable from the
photographs of real objects. We routinely train pilots with simulated airplanes, generating
graphical displays of a virtual environment in real time. Features length movies made entirely by
computers have been successful, both critically and financially.

1.2 Applications of Computer Graphics

The development of Computer Graphics had been driven both by needs of the user
community and by advances in hardware and software. The application of computer graphics are
many and varied, we can however divide them into of four major areas:

1. Display of information
2. Design
3. Simulation
4. User interface
Although many application span two or more of these areas, the development of the field was
based on separate work in each.

Dept. of CSE Page | 1


ROCKET LAUNCH 2020-2021

1.2.1 Display of information


Medical Imaging possesses interesting and important data analysis problem. Modern
imaging technologies such as Computed Tomography (CT), Magnetic Resonance Imaging
(MRI), Ultrasound and Position Emission Tomography (PET), generate 3D data that must be
subjected to algorithmic manipulation provide useful information. The field of scientific
visualization provides graphical tools that help the researchers interpret the fast quantity of data
that generate.

1.2.2 Design
Professions such as engineering and architecture are concerned with design. Starting with
a set of specifications, engineers and architects seek a cast effective and aesthetic solution that
satisfies the specifications.

Design is an interactive process. Design problems are either over determined such that they
possess no solution that satisfies all criteria, much less an optimal solution, or undetermined,
such that they have multiple solutions that satisfies the design criteria.

1.2.3 Simulation and Animation


Graphics system evolved to be capable of generating sophisticated images in real time,
engineers and researchers began to use them as simulators. One of the most important use had
been training of pilots. The use of special PLSI chips has led to a generation of arcade games as
sophisticated as flight simulators.

The simulators can be used for designing the robot, planning its path, and simulating its behavior
in complex environment. The success of flight simulators led to the use of Computer Graphics
for animation in TV, motion pictures and advertising industries. Entire animated movies can now
be made by computer at a cost less than that of movies with traditional ways.

Dept. of CSE Page | 2


ROCKET LAUNCH 2020-2021

1.2.4 User Interface


Our interaction with computers has become dominated by visual paradigm that includes
icons, menus and pointing devices such as mouse. From user’s perspective, winding system such
as X and window system, Microsoft windows.

1.3 Introduction to OpenGL


Most of the applications will be designed to access OpenGL directly through functions in
three libraries. Function in the main GL (or OpenGL in windows) library have names that begin
with the letters gl and are stored in a library usually referred to as GL. The second is the OpenGL
Utility Library (GLU). This library uses only GL functions but contains code for creating
common objects and simplifying programmers prefer not to write the code repeatedly. The GLU
library is available in all OpenGL implementations; functions in the GLU library begins with
letters glu.

To interface with the window system and to get input from external devices into programs, need
at least one more system-specific library that provides the “glue” between the window system
and OpenGL. For the X window system, this library is functionality that should be expected in
any modern windowing system. For this window system, GLUT will use GLX and the X
libraries. The application program, however, can use only GLUT functions and thus be
recompiled with the GLUT library for other window systems. We use GLU and C++ Library for
this project.

Dept. of CSE Page | 3


ROCKET LAUNCH 2020-2021

1.4 C
C++ programming language is a versatile programming language. Using C++ you can
create low end graphics too i.e. creating basic shapes and words with stylish fonts and adding
colors to them can be done using C++.

Graphic programming can be done in C++ using your terminal or command prompt or
you can download DevC++ compiler to create graphic programs. It includes computer graphics
and sound libraries designed to be used with the C++ programming language.

1.5 Block Diagram of OpenGL

Dept. of CSE Page | 4


ROCKET LAUNCH 2020-2021

CHAPTER 2

SYSTEM ANALYSIS

2.1 Existing System


The graphics project is designed using the graphics Utility library, which contains
graphics manipulation and creation APIs, which are implemented as part of project. The object
created during the course of development of this software consists of many geometric figures like
lines, rectangle, square, polygon, sphere, cube, etc. All the figures taken to be an array of X and
Y coordinates, similarly rectangles are stored as a set of 4 points etc. System analysis and design
is a very important process in any software development process. This process is called as
requirement analysis. Once all the requirements are collected, we can then proceed with the
actual designing of the system. During design process, we are involved in actual implementation
of the system.

2.2 Proposed System


The proposed system is developed by using python PyopenGL. It is implemented on
Windows. The 3D graphics packages designed here provides an interface for the user handling
the display. The proposed system provides the visual simulation to understand reflection, impact
of lighting surface with smoothness and shadow observation. On Command with Key clicks we
could zoom in & out, fill add & remove.

Dept. of CSE Page | 5


ROCKET LAUNCH 2020-2021

2.3 Aim
The main aim is to develop a graphic program that utilizes the features of the computer graphics.
The objective is to graphically illustrate the launching of fully functional Rocket into the earth’s
atmosphere and make it revolve around the earth in its Orbit.

CHAPTER 3

REQUIREMENT SPECIFICATIONS

3.1 User Requirements

• Easy to understand and should be simple.


• The built-in functions should be utilized to maximum extent.
• OpenGL library facilities should be used.

3.2 Software Requirements

• Any Windows OS
• Editor : Visual Studio Code.
• Language : C++

3.3 Hardware Requirements

• Processor: Pentium or Higher. (Preferred x64 bit – Intel i3 processor 1.6GHz)

Dept. of CSE Page | 6


ROCKET LAUNCH 2020-2021

• Ram: 4GB
• Hard Disk: 500GB (At least 80GB)
• Display: Intel HD graphics (128MB)
• Keyboard, Mouse

CHAPTER 4

IMPLEMENTATION

4.1 Built-In Functions

4.1.1 glRasterpos2i( )
mode: Specifies which matrix stack is the target for subsequent matrix operations. Three
values are accepted: GL_MODELVIEW , GL_PROJECTION , and GL_TEXTURE . The initial
value is GL_MODELVIEW . Additionally, if the ARB_imaging extension is supported,
GL_COLOR is also accepted.

4.1.2 glColor( * args )


Arguments can be red, green, blue Specify new red, green, and blue values for the current
color. Alpha Specifies a new alpha value for the current color. Included only in the four-
argument glColor4 commands.

Dept. of CSE Page | 7


ROCKET LAUNCH 2020-2021

4.1.3 glPopMatrix( ) & glPushMatrix( )


glPopMatrix( ( void ) ) -> void,glPopMatrix( )
glPushMatrix( ( void ) ) -> void glPushMatrix( )
push and pop the current matrix stack

4.1.4 glTranslate()
Multiply the current matrix by a translation matrix
glTranslate( ) -> glTranslate( x , y , z )
glTranslated( x , y , z ) glTranslatef( x , y , z )

Specify the x , y , and z coordinates of a translation vector.

4.1.5 glRotate()
multiply the current matrix by a rotation matrix
glRotate( )-> glRotate( angle , x , y , z )
glRotated( angle , x , y , z ) glRotatef( angle ,
x,y,z)

Angle: Specifies the angle of rotation, in degrees.


x, y, z : Specify the x , y , and z coordinates of a vector, respectively.

4.1.6 Draw a Rocket


gluRocket( quad , radius , slices , stacks )
Quad: Specifies the quadrics object (created with gluNewQuadric ).
Radius: Specifies the radius of the sphere.

Dept. of CSE Page | 8


ROCKET LAUNCH 2020-2021

Slices: Specifies the number of subdivisions around the z axis (similar to lines of
longitude).
Stacks: Specifies the number of subdivisions along the z axis (similar to lines of latitude).

4.1.7 Draw a disk


gluDisk( quad , inner , outer , slices , loops ) quad: Specifies the
quadrics object (created with gluNewQuadric ).

Inner: Specifies the inner radius of the disk (may be 0).


Outer: Specifies the outer radius of the disk.
Slices: Specifies the number of subdivisions around the z axis.
Loops: Specifies the number of concentric rings about the origin into which the disk is
subdivided.

4.1.8 Draw an arc of a disk


gluPartialDisk( quad , inner , outer , slices , loops , start , sweep ) quad:
Specifies a quadrics object (created with gluNewQuadric ).

Inner: Specifies the inner radius of the partial disk (can be 0).
Outer: Specifies the outer radius of the partial disk.
Slices: Specifies the number of subdivisions around the z axis.
Loops: Specifies the number of concentric rings about the origin into which the partial
disk is subdivided.
Start: Specifies the starting angle, in degrees, of the disk portion.
Sweep: Specifies the sweep angle, in degrees, of the disk portion.

Dept. of CSE Page | 9


ROCKET LAUNCH 2020-2021

4.1.9 Specify the draw style desired for quadrics


gluQuadricDrawStyle( quad , draw ) quad: Specifies the
quadrics object (created with gluNewQuadric ).

Draw: Specifies the desired draw style. Valid values are GLU_FILL , GLU_LINE ,
GLU_SILHOUETTE , and GLU_POINT .

4.1.10 Draw a cylinder


gluCylinder( quad , base , top , height , slices , stacks ) quad:
Specifies the quadrics object (created with gluNewQuadric ).

Base: Specifies the radius of the cylinder at z = 0.


Top: Specifies the radius of the cylinder at z = height .
Height: Specifies the height of the cylinder.
Slices: Specifies the number of subdivisions around the z axis.
Stacks: Specifies the number of subdivisions along the z axis.

4.1.11 Set up a perspective projection matrix


gluPerspective( fovy , aspect , zNear , zFar ) fovy: Specifies the
field of view angle, in degrees, in the y direction.

Aspect: Specifies the aspect ratio that determines the field of view in the x direction. The
aspect ratio is the ratio of x (width) to y (height). zNear: Specifies the distance from the
viewer to the near clipping plane (always positive). zFar: Specifies the distance from the
viewer to the far clipping plane (always positive).

Dept. of CSE Page | 10


ROCKET LAUNCH 2020-2021

4.1.12 Clear buffers to preset values


glClear( mask )
mask: Bitwise OR of masks that indicate the buffers to be cleared. The three masks are
GL_COLOR_BUFFER_BIT,GL_DEPTH_BUFFER_BIT,and,GL_STENCIL_BUFFER_
BIT .

4.1.13 Enable or disable server-side GL capabilities


glDisable( cap ) glEnable( cap ) cap: Specifies a symbolic constant indicating a GL
capability.
Index: Specifies the index of the switch to disable (for glEnablei and glDisablei only).

4.1.14 Specify whether front- or back-facing facets can be culled


glCullFace( mode ) mode: Specifies whether front- or back-facing facets are candidates
for culling. Symbolic constants GL_FRONT, GL_BACK, and
GL_FRONT_AND_BACK are accepted. The initial value is GL_BACK.

4.1.15 Specify the value used for depth buffer comparisons


glDepthFunc( func )
func: Specifies the depth comparison function. Symbolic constants GL_NEVER ,
GL_LESS , GL_EQUAL , GL_LEQUAL , GL_GREATER , GL_NOTEQUAL ,
GL_GEQUAL , and GL_ALWAYS are accepted. The initial value is GL_LESS.

Dept. of CSE Page | 11


ROCKET LAUNCH 2020-2021

4.1.16 set light source parameters


glLight( light , pname , params ) light: Specifies a light. The number of lights depends
on the implementation, but at least eight lights are supported. They are identified by
symbolic names of the form GL_LIGHT i , where i ranges from 0 to the value of
GL_MAX_LIGHTS - 1.
Pname: Specifies a single-valued light source parameter for light.
GL_SPOT_EXPONENT
,GL_SPOT_CUTOFF,GL_CONSTANT_ATTENUATION,GL_LINEAR_ATTENUATI
ON , and GL_QUADRATIC_ATTENUATION are accepted.
Param: Specifies the value that parameter pname of light source light will be set to.

4.1.17 specify material parameters for the lighting model


glMaterial( faces , constant , * args ) glMaterialf(
face , pname , param )

face: Specifies which face or faces are being updated. Must be one of GL_FRONT ,
GL_BACK , or GL_FRONT_AND_BACK .
pname: Specifies the single-valued material parameter of the face or faces that is being
updated. Must be GL_SHININESS .
param: Specifies the value that parameter GL_SHININESS will be set to.

Dept. of CSE Page | 12


ROCKET LAUNCH 2020-2021

4.2 Header files/imports

#include<GL/glut.h>
#include<stdlib.h>
#include<stdio.h>
#include<math.h>
#include<string.h>

4.3 Variable Declaration.


4.3.1 Light setting
# light settings light_ambient =
[0.0, 0.0, 0.0, 1.0] light_diffuse =
[1.0, 1.0, 1.0, 1.0] light_specular =
[1.0, 1.0, 1.0, 1.0] light_position =
[2.0, 5.0, 5.0, 0.0] mat_ambient =
[0.7, 0.7, 0.7, 1.0] mat_diffuse =
[0.8, 0.8, 0.8, 1.0] mat_specular =
[1.0, 1.0, 1.0, 1.0] high_shininess
= [100.0]

4.3.2 Planet-color
# color and other variables for easy modification planetColor
= (0.0, 0.6, 0.7)
partialDiskColor=(0.7, 0.4, 0.0)

4.3.3 Sides slices


=7
stacks = 7

4.3.4 Keyboard keys


xrayButton = 1 xyz_pos
= 0.1 movingDown =
False z_pos = -8
4.4 Function Declaration
4.4.1 Draw Solid

def draw(slices, stacks):


t = time.time() % 1000
angle = t*90 quad =
gluNewQuadric()
glColor3fv(planetColor)

Dept. of CSE Page | 13


ROCKET LAUNCH 2020-2021

# planet
glPushMatrix()
glTranslatef(1.8, 1.5, -6)
glRotatef(45,1,0,0)
glRotatef(angle,0,0,1)
gluSphere(quad, 2, slices, stacks) # quads, radius, slices, stacks
glPopMatrix()

# partial disk to demonstrate overlapping glColor3fv(partialDiskColor) glPushMatrix()


glTranslatef(4.4, 1.5, -6) # glRotatef(-60, 1, 0.2, 0) glRotatef(-angle, 0, 0, 1)
gluPartialDisk(quad, 0.5, 1, slices, stacks, 0, 270) # quad, inner, outer, slices, loops, start angle,
sweep angle
glPopMatrix()

# Rings
glColor3f(1.0, 0.8, 0.2) # controles the color of the rings
glPushMatrix() glTranslatef(1.8, 1.5, -6) # glRotatef(-60,
1, 0.2, 0) glRotatef(-angle, 0, 1, 1)
gluDisk(quad, 2.2, 2.7, slices, stacks) # quad, inner, outer, slices, loops
glPopMatrix()

# glColor3f(0.7, 0.5, 0.0) # If you need to change the color of the other ring
glPushMatrix() glTranslatef(1.8, 1.5, -6)
glRotatef(-60, 1, 0.2, 0) # pre rotated by an angle glRotatef(-
angle, 1, 0, 1) # contineous rotation of the ring gluDisk(quad, 2.2,
2.7, slices, stacks) # quad, inner, outer, slices, loops glPopMatrix()

4.4.2 Wire frame


### This code contains same set of code as from “Draw Solid” and as an additional line.
gluQuadricDrawStyle(quad, GLU_LINE)

4.4.3 Moving UFO def


UFO(xyz_pos):
t = time.time() % 1000
angle = t * 90

quad = gluNewQuadric()

glColor3f(0.4, 0.1, 0.4)


glPushMatrix()
glTranslatef(1, 1.5, -8) #was -8
glTranslatef(xyz_pos, xyz_pos, -xyz_pos)
glRotatef(45, 1, 0, 0)
glRotatef(angle, 0, 0, 1)
gluSphere(quad, 1, 17, 17) # quads, radius, slices, stacks
# glRotatef(70, 1, 0, 0)

Dept. of CSE Page | 14


ROCKET LAUNCH 2020-2021

glPopMatrix()

glColor3f(0.4, 0.8, 0.2)


glPushMatrix()
glTranslatef(1, 0.56, -8)
glTranslatef(xyz_pos, xyz_pos, -xyz_pos)
glRotatef(-90, 1, 0.0, 0)
glRotatef(angle, 0, 0, 1)
gluCylinder(quad, 1.5, 0.74, 1.6, 17, 17) # quads, base, top, height, slices, stacks
glPopMatrix()

4.4.4 Main Function

def main():
slices = 7
stacks = 7

xrayButton = 1
xyz_pos = 0.1
movingDown = False
z_pos = -8

pygame.init()
display = (800, 600)
pygame.display.set_mode(display, DOUBLEBUF | OPENGL)

glMatrixMode(GL_PROJECTION)
gluPerspective(45, (display[0] / display[1]), 0.1, 50.0)

glMatrixMode(GL_MODELVIEW)
glTranslatef(-2.0, -1.0, -5) #
glTranslatef(0,0,-5) while True:
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
quit() if event.type == pygame.KEYDOWN: if
event.key == pygame.K_UP: slices += 1 stacks +=
1 if event.key == pygame.K_DOWN and (slices > 3 and stacks >
3): slices -= 1 stacks -= 1 if event.key ==
pygame.K_x: xrayButton = xrayButton+1

# camera controles
if event.key == pygame.K_a:
glTranslatef(0.5, 0, 0) if
event.key == pygame.K_d:
glTranslatef(-0.5, 0, 0)

Dept. of CSE Page | 15


ROCKET LAUNCH 2020-2021

if event.key == pygame.K_w:
glTranslatef(0, -0.5, 0) if
event.key == pygame.K_s:
glTranslatef(0, 0.5, 0) if event.type ==
pygame.MOUSEBUTTONDOWN: if
event.button == 4: glTranslatef(0, 0, 0.5)
if event.button == 5: glTranslatef(0, 0, -0.5)
# logic to move the UFO if(movingDown):
if(xyz_pos > -4): xyz_pos = xyz_pos - 0.04
else:
movingDown = False
else:
if(xyz_pos < 8):
xyz_pos = xyz_pos + 0.04
else:
movingDown = True

# glRotatef(1, 3, 1, 1)
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
glColor3f(1.0, 1.0, 3.0)

# drawing begins here


if(xrayButton % 2):
draw(slices, stacks) else:
xrayDraw(slices, stacks)
UFO(xyz_pos)

# background color (space color)


glClearColor(0.0, 0.0, 0.12, 1)
glEnable(GL_CULL_FACE)
glCullFace(GL_BACK)

glEnable(GL_DEPTH_TEST)
glDepthFunc(GL_LEQUAL)

glEnable(GL_LIGHT0)
glEnable(GL_NORMALIZE)
glEnable(GL_COLOR_MATERIAL)
glEnable(GL_LIGHTING)

glLightfv(GL_LIGHT0, GL_AMBIENT, light_ambient)


glLightfv(GL_LIGHT0, GL_DIFFUSE, light_diffuse) glLightfv(GL_LIGHT0,
GL_SPECULAR, light_specular)
glLightfv(GL_LIGHT0, GL_POSITION, light_position)

Dept. of CSE Page | 16


ROCKET LAUNCH 2020-2021

glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient)


glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse) glMaterialfv(GL_FRONT,
GL_SPECULAR, mat_specular)
glMaterialfv(GL_FRONT, GL_SHININESS, high_shininess)

pygame.display.flip()
pygame.time.wait(10)

angle = 0
main()

CHAPTER 5
SCREENSHOTS

Fig 1: Initial View of the Primitive Objects Under Lighting.

Dept. of CSE Page | 17


ROCKET LAUNCH 2020-2021

Fig 2: Initial WireFrame (keyboard key – X)

Fig 3: Non Smooth Object (Reduce sides using key)

Dept. of CSE Page | 18


ROCKET LAUNCH 2020-2021

Fig 4: Smooth Surface Object (Increase sides using key)

Fig 5: Smooth Surface in WireFrame View.

Dept. of CSE Page | 19


ROCKET LAUNCH 2020-2021

Fig 6: Zoom In (Scroll Wheel).

Dept. of CSE Page | 20


CHAPTER 6
CONCLUSION
This program allows to observe the components of light used on a primitive object, Using
Pygame & PyOpenGL graphics library we were able to demonstrate the lighting effect
and smooth shading on object. Using glu and it’s built-in function to design the function
for object and create the required result. All this was done using python as the core
language. we accomplished the purpose that is to observe lighting of an object and it’s
shadow using primitives as object to simulate 3D workspace. With the demonstration of
wireframe, which is an example for understanding Color-fills, With the demonstration of
Key listings & increasing & decreasing the sides gradually Observe Surface
Smoothness increase if a primitive object comprises higher number of sides. With the
demonstration of Zoom in & Zoom out function we could have a better observation of the
shadow and Surface Smoothness. Finally we were able to create a 3D models using
PyOpenGL in Pygame window.

FUTURE ENHANCEMENT:
To allow spectating mode for users to observe 3D objects better and Allow reposition of
Light sources to observe more of reflection effects on surface with shadow differential.
BIBLIOGRAPHY

Textbook Referred:
 Interactive Computer Graphics, A Top-Down Approach with OpenGL – Edward
Angel, 5th Edition, Addison- Wesley- 2008
 The official Guide to Learning OpenGL, by Jackie Nedier, Tom Davis, Mason
Woo (THE RED BOOK)

 OpenGL Super Bible by Richard S, Wright Jr and Michael Sweet.


 Donald Hearn & Pauline Baker: Computer Graphics with OpenGL Version, 3rd or
4th Edition, Pearson Education, 2011

Website Referred:
 https://github.com/DarkSchokolade/PyopenGL_Gubbins/bob/master/Plizzanet.py
 www.pypi.org/projects/PyOpenGL/
 www.stackoverflow.com
 www.youtube.com

You might also like