0% found this document useful (0 votes)
112 views17 pages

Origami-Paper Folding Simulation

This document provides an introduction to OpenGL and computer graphics. It discusses that OpenGL is a software interface that renders 2D and 3D objects and consists of about 150 commands. Primitives like points, lines and polygons are used to build models. The document also gives an overview of the basic OpenGL processing pipeline including display lists, vertex operations, rasterization, and framebuffer operations. Common uses of computer graphics like charts, CAD, virtual reality, scientific visualization, education, art, and entertainment are also summarized.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
112 views17 pages

Origami-Paper Folding Simulation

This document provides an introduction to OpenGL and computer graphics. It discusses that OpenGL is a software interface that renders 2D and 3D objects and consists of about 150 commands. Primitives like points, lines and polygons are used to build models. The document also gives an overview of the basic OpenGL processing pipeline including display lists, vertex operations, rasterization, and framebuffer operations. Common uses of computer graphics like charts, CAD, virtual reality, scientific visualization, education, art, and entertainment are also summarized.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

Origami-Paper Folding Simulation

CHAPTER 1

INTRODUCTION

As a software interface for graphics hardware, OpenGL's main purpose is to render two-
and three-dimensional objects into a frame buffer. These objects are described as sequences of
vertices or pixels. OpenGL performs several processing steps on this data to convert it to pixels to
form the final desired image in the frame buffer.

1.1WHAT IS OPENGL?
OpenGL is a software interface to graphics hardware. This interface consists of about150
distinct commands that you use to specify the objects and operations needed to produce interactive
three-dimensional applications.
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 we're using. Similarly, OpenGL
doesn't provide high-level commands for describing models of 3 dimensional objects. Such
commands might allow you to specify relatively complicated shapes such as automobiles, parts of
the body, airplanes, or molecules. With OpenGL, you must build up your desired model from a
small set of geometric primitives- points, lines, and polygons.

1.2 OPENGL FUNDAMENTALS:


OpenGL draws primitives—points, line segments, or polygons—subject to several
selectable modes.
You can control modes independently of each other; that is, setting one mode doesn't
affect whether other modes are set .Primitives are specified, modes are set, and other OpenGL
operations are described by issuing commands in the form of function calls. Primitives are defined
by a group of one or more vertices. A vertex defines a point, an endpoint of a line, or a corner of a
polygon where two edges meet. Data is associated with a vertex, and each vertex and its associated
data are processed independently, in order, and in the same way. The type of clipping depends on
which primitive the group of vertices represents. Commands are always processed in the order in
which they are received, although there may be an indeterminate delay before a command takes
effect. This means that each primitive is drawn completely before any subsequent command takes

Dept. of CSE, KLECET, Chikodi 2019-20 Page 1


Origami-Paper Folding Simulation

effect. It also means that state-querying commands return data that's consistent with complete
execution of all previously issued OpenGL commands.

1.2.1WHAT IS GLUT?
GLUT is a complete API written by Mark Kilgard which lets you create windows and
handle the messages. It exists for several platforms, that means that a program which uses GLUT
can be compiled on many platforms without (or at least with very few) changes in the code.

1.3 BASIC OPENGL OPERATION:


The figure shown below gives an abstract, high-level block diagram of how OpenGL
processes data. In the diagram, commands enter from the left and proceed through what can be
thought of as a processing pipeline. Some commands specify geometric objects to be drawn, and
others control how the objects are handled during the various processing stages. As shown by the
first block in the diagram, rather than having all commands proceeds immediately through the
pipeline, you can choose to accumulate some of them in a display list for processing at a later time.

Display list

Evaluator Per-Vertex Operation Rasterization Per-Fragment


And primitive Assembly Operation

Frame B
Texture
Memory

Pixel
Operations

Fig 1: OpenGL Block Diagram

Dept. of CSE, KLECET, Chikodi 2019-20 Page 2


Origami-Paper Folding Simulation

Rasterization produces a series of frame buffer addresses and associated values using a
two-dimensional description of a point, line segment, or polygon. Each fragment so produced is fed
into the last stage, Per-fragment operations, which perform the final operations on the data before
it's stored as pixels in the frame buffer. These operations include conditional updates to the frame
buffer based on incoming and previously stored z-value s (for z-buffering) and blending of
incoming pixel colors with stored colors, as well as masking and other logical operations on pixel
values. All elements of OpenGL state, including the contents of the texture memory and even of the
frame buffer, can be obtained by an OpenGL application.

1.4 OBJECTIVE OF PROGRAM:


The objective is to use the basic primitives defined in openGL librarycreating complex
objects. We make use of different concepts such as display(), idle(), specialkeys(), updaterotate(),
onmousebutton() and other functions. The main objective of this program is to implement simple
and basic functions of OpenGL.

1.5 USES OF COMPUTER GRAPHICS:


Computer graphics is used in many different areas of industry, business, government,
education, entertainment, Image processing, User Interfaces;
1) Graphs and Charts:
ÿ An early application for computer graphics is the display of simple data graphs usually plotted
on a character printer.
ÿ Data plotting is still one of the most common graphics applications. Graphs & charts are
commonly used to summarize functional, statistical,mathematical, engineering and economic
data for research reports, managerial summaries and other types of publications.
ÿ Typically examples of data plots are line graphs, bar charts, pie charts, surface graphs, contour
plots and other displays showing relationships between multiple parameters in two dimensions,
three dimensions, or higher-dimensional spaces. Three dimensional graphs and charts are used to
display additional parameter information sometimes they are used for effect, providing more
dramatic or more attractive presentations of the data relationships.
2) Computer Aided Drafting and Design (CAD):
ÿ A major use of computer graphics is in design processes-particularly for engineering and
architectural systems. CAD, computer-aided design or CADD, computer-aided drafting and

Dept. of CSE, KLECET, Chikodi 2019-20 Page 3


Origami-Paper Folding Simulation

design methods are now routinely used in the automobiles, aircraft, spacecraft, computers, home
appliances.
ÿ Circuits and networks for communications, water supply or other utilities are constructed with
repeated placement of a few geographical shapes. Animations are often used in CAD
applications.
ÿ When object designs are complete, realistic lighting conditions and surface rendering are applied
to produce displays that will show the appearance of the final product.
3) Virtual-Reality Environments:
ÿ A more recent application of computer graphics is in the creation of virtual-reality environments
in which a user can interact with the objects in a three dimensional scene.
ÿ Animations in virtual-reality environments are often used to train heavy-equipment operators or
to analyse the effectiveness of various cabin configurations and control placements.
ÿ With virtual-reality systems, designers and others can move about and interact with objects in
various ways. With a special glove, we can even “grasp” objects in a scene and turn them over or
move them from one place to another.
4) Data Visualizations:
ÿ Producing graphical representations for scientific, engineering and medical data sets and
processes is another fairly new application of computer graphics, which is generally referred to
as scientific visualization.And the term business visualizationis used in connection with data sets
related to commerce, industry and other non-scientific areas.
ÿ Visual techniques are also used to aid in the understanding and analysis of complex processes
and mathematical functions.
ÿ A color plot of mathematical curve functions.
5) Education and Training :
ÿ Computer generated models of physical,financial,political,social,economic& other systems are
often used as educational aids.
ÿ Models of physical processes physiological functions,equipment, such as the color coded
diagram as shown in the figure, can help trainees to understand the operation of a system.

6) Computer Art:
ÿ The picture is usually painted electronically on a graphics tablet using a stylus, which can
simulate different brush strokes, brush widths and colors.

Dept. of CSE, KLECET, Chikodi 2019-20 Page 4


Origami-Paper Folding Simulation

ÿ Fine artists use a variety of other computer technologies to produce images. To create pictures
the artist uses a combination of 3D modelling packages, texture mapping, drawing programs and
CAD software etc.
ÿ Commercial art also uses theses “painting” techniques for generating logos & other designs,
page layouts combining text & graphics, TV advertising spots & other applications.
7) Entertainment:
ÿ Television production, motion pictures, and music videos routinely a computer graphics method.
ÿ Some television programs also use animation techniques to combine computer generated figures
of people, animals, or cartoon characters with the actor in a scene or to transform an actor’s face
into another shape.
ÿ Advanced computer-modelling & surface-rendering methods were employed in 2 award-winning
short films to produce the scenes.
8) Image Processing:
ÿ The modification or interpretation of existing pictures, such as photographs and TV scans is
called image processing.
ÿ Methods used in computer graphics and image processing overlap, the two areas are concerned
with fundamentally different operations.
ÿ In computer graphics, a computer is used to create a pictures. Image processing methods are
used to improve picture quality, analyse images, or recognize visual patterns for robotics
applications.
9) Graphical User Interfaces:
ÿ It is common now for applications software to provide graphical user interface (GUI) .
ÿ A major component of graphical interface is a window manager that allows a user to display
multiple, rectangular screen areas called display windows.
ÿ Each screen display area can contain a different process, showing graphical or non-graphical
information, and various methods can be used to activate a display window.
ÿ Using an interactive pointing device, such as mouse, we can active a display window on some
systems by positioning the screen cursor within the window display area and pressing the left
mouse button.

Dept. of CSE, KLECET, Chikodi 2019-20 Page 5


Origami-Paper Folding Simulation

CHAPTER 2

REQUIRMENTS SPECIFICATION
The requirements can be broken down into 2 major categories namely hardware and
software requirements. The former specifies the minimal hardware facilities expected in a system in
which the project has to be run. The latter specifies the essential software needed to build and run
the project.

2.1 HARDWARE REQUIREMENTS:

The hardware requirement is minimal and the software can run with minimal
requirements. The basic requirements are as enlisted below:

ÿ Processor: Intel 486/ Pentium processor or a processor with higher specifications.


ÿ RAM : 128Mb
ÿ Mouse or other pointing device.
ÿ Hard Disk: 3GB (approx.), 5400 RPM hard disk drive.
ÿ The standard output device is required to be a Color Monitor. It is quite essential for any
graphics packages of color options to the user is must. VGA compatible (CRT or LCD-TFT).

2.2 SOFTWARE REQUIREMENTS:

ÿ Operating System: Unix 14.0 or above.


ÿ An MS-DOS based on Unix operating system like is Ubuntu, Fedora are the platform required to
develop the 3D simulation.
ÿ A C/C++ (integrated with OPEN GL) compiler like gcc is required for compiling the source code
to make the executable file which can then be directly executed.
ÿ A built in graphics library, glut.h is required for drawing the layout of the output.
ÿ glut32.dll for running the application.

Dept. of CSE, KLECET, Chikodi 2019-20 Page 6


Origami-Paper Folding Simulation

CHAPTER 3

SYSTEM DESIGN

This project is designed for supporting different transformation functions and event
driven function of OpenGL on primary objects. The aim of the project is to simulate a paper
aeroplane in open space using OpenGL functions.

3.1 DESCRIPTION:

This project is simple one where one just folds the paper and unfolds it. This project shows
the entire process of folding as well as unfolding. Each folding section has been curved with the
line. The single paper is divided into cross sections and each folding position is marked. Each states
has been enumerated. The lists of points make it possible to make the fold with recognizing what
state to follow. While rendering and movement is done easily but folding with good angle
specification is need. Motion of the Paper while it get fold (unfold) make more sense as it make
more visibility to user.
This project has been created using the OpenGL interface along with the GLUT( OpenGL
Library Toolkit), using the platform GCC as the compiling tool.
This project is a basic implementation to simulate a paper aeroplane in open space. This
is being simulated into a paper boat using keyboard keys and functions. It provides the user,
ability to rotate the paper aeroplane around at 360 angles in the open space by changing the
viewing angle and position using the keyboard keys.

The program provides user to set the different stages of the paper aeroplane simulation
and to check the origami simulation of the object at each level and can view the final simulation
by rotating it clockwise and anti-clockwise.

Requirement analysis encompasses all the tasks that go in to the instigation, scoping and
definition the new or altered system. Requirement analysis is an important part of design
process.

Dept. of CSE, KLECET, Chikodi 2019-20 Page 7


Origami-Paper Folding Simulation

Start

Display

Press ENTER Iteration Press q

Start Simulation Stop

Fig 3: Flow chart

Dept. of CSE, KLECET, Chikodi 2019-20 Page 8


Origami-Paper Folding Simulation

CHAPTER 4

IMPLEMENTATION

4.1 HEADER FILES:

# include <stdlib.h>

The ISO C standard introduced this header file as a place to declare certain standard
library functions. These include the Memory management functions (malloc, free, et. al.)
communication with the environment (abort, exit) and others. Not yet all the standard functions of
this header file are supported. If a declaration is present in the supplied header file, then supports it
and will continue to support it. If a function is not there, it will be added in time.

# include <stdio.h>

Load the file SIMPLEIO.C for our first look at a file with standard I/O. Standard I/O
refers to the most usual places where data is either read from, the keyboard, or written to, the video
monitor. Since they are used so much, they are used as the default I/O devices and do not need to be
named in the Input/Output instructions. This will make more sense when we actually start to use
them so let’s look at the file in front of you.

The first things you will notice is the second line of the file, the #include "stdio.h" line.
This is very much like the #define we have already studied, except that instead of a simple
substitution, an entire file is read in at this point. The system will find the file named "stdio.h" and
read its entire contents in, replacing this statement. Obviously then, the file named "stdio.h" must
contain valid C source statements that can be compiled as part of a program. This particular file is
composed of several standard #defines to define some of the standard I/O operations. The file is
called a header file and you will find several different header files on the source disks that came
with your C compiler. Each of the header files has a specific purpose and any or all of them can be
included in any program.

4.2 PRE DEFINED FUNCTIONS:


ÿ void glutKeyboardFunc(void (*func)(unsigned char key, int x, int y));
Where Func is the new keyboard callback function. glutKeyboardFunc sets the keyboard
callback for the current window. When a user types into the window, each key press generating
an ASCII character will generate a keyboard callback. The key callback parameter is the

Dept. of CSE, KLECET, Chikodi 2019-20 Page 9


Origami-Paper Folding Simulation

generated ASCII character. The x and y callback parameters indicate the mouse location in
window relative coordinates when the key was pressed. When a new window is created, no
keyboard callback is initially registered, and ASCII key strokes in the window are ignored.
Passing NULL to glutKeyboardFunc disables the generation of keyboard callbacks.
ÿ void glFlush( );
Different GL implementations buffer commands in several different locations, including
network buffers and the graphics accelerator itself glFlush empties all of these buffers, causing
all issued commands to be executed as quickly as they are accepted by the actual rendering
engine. Though this execution may not be completed in any particular time period, it does
complete in finite time.
ÿ void glMatrixMode(GLenum mode);
In this function 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.
The glMatrixMode sets the current matrix mode can assume one of the values:
GL_PROJECTION: Applies subsequent matrix operations to the projection matrix stack.

4.3 VARIOUS OTHER FUNCTIONS:

ÿ glutInit() : interaction between the windowing system and OPENGL is initiated.


ÿ glutInitDisplayMode() : used when double buffering is required and depth information is
required.

ÿ glutCreateWindow() : this opens the OPENGL window and displays the title at top of the
window.

ÿ glutInitWindowSize() : specifies the size of the window.

ÿ glutInitWindowPosition() : specifies the position of the window in screen co-ordinates.

ÿ glutKeyboardFunc() : This function handles normal ASCII symbols.

ÿ glutSpecialFunc() : handles special keyboard keys.

ÿ glutReshapeFunc() : sets up the call back function for reshaping the window.

ÿ glutIdleFunc() : this handles the processing of the background.

ÿ glutDisplayFunc() : this handles redrawing of the window.

Dept. of CSE, KLECET, Chikodi 2019-20 Page 10


Origami-Paper Folding Simulation

ÿ glutMainLoop() : this starts the main loop, it never returns.

ÿ Display():sets the background colour and clears the color buffer bit, and depth buffer bit ( for
hidden surface removal and Z buffer test), and it is called from the main().

ÿ glViewport() : used to set up the viewport.

ÿ glVertex3fv() : used to set up the points or vertices in three dimensions.

ÿ glColor3fv() : used to render color to faces.

ÿ glFlush() : used to flush the pipeline.

ÿ glutPostRedisplay() : used to trigger an automatic redraw of the object.

ÿ glMatrixMode() : used to set up the required mode of the matrix.

ÿ glLoadIdentity() : used to load or initialize to the identity matrix.


CHAPTER 5

5.1 ADVANTAGES:
ÿ Use of one’s fingers improves fine motor skills and brain development.
ÿ Develops imagination and a sense of color.
ÿ Improves concentration and spatial awareness.
ÿ Origami is well-suited to working with large classrooms and in a multi-age setting.
ÿ It is bridge to Math, transforming a flat piece of paper into a three-dimensional figure is a unique
exercise in spatial reasoning.
ÿ Through the actual folding, children use their hands to follow a specific set of steps in sequence,
producing a visible result that is at once clever and pleasing.

5.2 DISADVANTAGES:

ÿ Kami isn’t super high quality and usually only comes in 15x15 cm squares. If you are folding
anything super complex you will need bigger and higher quality paper.
ÿ It is very hard to use for origami because it is so thick and doesn’t hold creases very well.
ÿ Often you will need to treat the paper first to get crisp enough to fold.

Dept. of CSE, KLECET, Chikodi 2019-20 Page 11


Origami-Paper Folding Simulation

CHAPTER 6

SNAPSHOTS

Fig 1. Screenshot of folded aeroplane

Fig 2. Screenshot of unfolding aeroplane

Dept. of CSE, KLECET, Chikodi 2019-20 Page 12


Origami-Paper Folding Simulation

Fig 3. Screenshot of unfolding

Fig 4. Screenshot of unfolding

Dept. of CSE, KLECET, Chikodi 2019-20 Page 13


Origami-Paper Folding Simulation

Figure 5.screenshot of Unfolding

Figure 6. screenshot of plane paper

Dept. of CSE, KLECET, Chikodi 2019-20 Page 14


Origami-Paper Folding Simulation

Figure 7. screenshot of folding

Figure 8. screenshot of folding paper

Dept. of CSE, KLECET, Chikodi 2019-20 Page 15


Origami-Paper Folding Simulation

Fig 9: screenshot of completely folded aeroplane

Fig 10: screenshot of unfolding paper

Dept. of CSE, KLECET, Chikodi 2019-20 Page 16


Origami-Paper Folding Simulation

CHAPTER 7

CONCLUSION:

This project shows the various methods to implement paper folding mechanism using
Paper. The objective of this program is to implement simple and basic functions of OpenGL.
Computer graphics plays a major role in today’s world where visualization takes the upper hand as
compared to textual interaction. This is largely true as we can see user interface becoming more and
more attractive all thanks to major leaps in the fields of computer graphics. The project is
implemented using graphics OpenGL package provided by C++.

BIBLIOGRAPHY
Book references:
ÿ Donald Hearn & Pauline Baker: Computer Graphics with OpenGL Version, 3rd / 4th Edition,
Pearson Education, 2011.
ÿ Edward Angel: Interactive Computer Graphics- a Top Down approach with OpenGL, 5th
edition. Pearson Education, 2008.

Website references:
ÿ https://www.khronos.org/opengl/wiki/Getting_Started
ÿ https://www.opengl.org/sdk/docs/tutorials/OGLSamples/
ÿ https://www.geeksforgeeks.org/getting-started-with-opengl/
ÿ https://www.khronos.org/opengl/wiki//Code_Resources
ÿ http://www.lighthouse3d.com/tutorials/glut-tutorial/
ÿ http://code-blocks.blogspot.in/2014/12/html
ÿ https://github.com/sprintr/opengl-examples/blob/master/OpenGL-Menu.cpp

Dept. of CSE, KLECET, Chikodi 2019-20 Page 17

You might also like