Top Banner
Under the guidance of: Mr. S Prabhudeva B.E, M.S. (Ph.D) Mrs. Thaseen Bhashith B.E,M.Tech Assoc. Prof, Dept. of CSE Lecturer, Dept. of CSE Submitted by: ARUN KUMAR .K 4JN08CS401 AYOOB C.H 4JN04CS013 Jawaharlal Nehru National College of Engineering Department of Computer Science & Engineering
19
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: OpenGL Projects on SIMULATION OF WATER RIPPELS

Under the guidance of:

Mr. S Prabhudeva B.E, M.S. (Ph.D) Mrs. Thaseen Bhashith B.E,M.Tech

Assoc. Prof, Dept. of CSE Lecturer, Dept. of CSE

Submitted by:

ARUN KUMAR .K 4JN08CS401 AYOOB C.H 4JN04CS013

Jawaharlal Nehru National College of Engineering

Department of Computer Science & Engineering

Page 2: OpenGL Projects on SIMULATION OF WATER RIPPELS

Contents

AbstractAbout Computer GraphicsAbout openGL Introduction Working principleDesign and ImplementationConclusion & Future scopeReferences

Page 3: OpenGL Projects on SIMULATION OF WATER RIPPELS

Abstract

To demonstrate the simulation of water ripples on surface by using open-GL APIs.

Page 4: OpenGL Projects on SIMULATION OF WATER RIPPELS

About Computer Graphics

A powerful tool for the rapid and economical production of pictures.

Is a generalized tool for drawing and creating pictures.

Simulate the real world situations within a small computer window.

Page 5: OpenGL Projects on SIMULATION OF WATER RIPPELS

About openGL

• OpenGL is a device and operating system independent library for 3D-graphics and rendering.

• OpenGL is a standard specification defining a cross-language, cross-platform API.

• The interface consists of many different function calls which can be used for building application programs.

• OpenGL is portable to many platforms and callable from many programming languages.

Page 6: OpenGL Projects on SIMULATION OF WATER RIPPELS

Aim:To develop a graphics package that utilizes the features of the computer graphics.

Objectives:The main objective this project is to graphically illustrate the simulation of water ripples on surface.

Introduction

Page 7: OpenGL Projects on SIMULATION OF WATER RIPPELS

Working principle

We need 2 arrays of words (integers). That is , words, not bytes. These arrays will hold the state of the water.

One holds the current state, the other holds the state from the previous frame. It is important that we have 2 arrays, since we need to know how the water has changed since the last frame, and the frame before that.

Page 8: OpenGL Projects on SIMULATION OF WATER RIPPELS

Cont working…

Page 9: OpenGL Projects on SIMULATION OF WATER RIPPELS

Cont Working…

• Data from the previous frame (Buffer2) and the frame before that (Buffer1) are used together, and the results written into Buffer1.Buffer1 contains the current state of the water.

• Data from the previous frame (Buffer1) and the frame before that (Buffer2) are used together, and the results written into Buffer2. Buffer2 contains the current state of the water.

Page 10: OpenGL Projects on SIMULATION OF WATER RIPPELS

Cont Working…

Page 11: OpenGL Projects on SIMULATION OF WATER RIPPELS

Design and Implementation

Built-in library functions :

• glViewport(0, 0, width, height);

• glMatrixMode(GL_PROJECTION);

• glLoadIdentity();

• gluPerspective(40.0, (GLfloat) w/(GLfloat) h, 1.0, 2000.0);

• glMatrixMode(GL_MODELVIEW);

• glLoadIdentity ();

• glutSwapBuffers();

• glutFullScreen();

Page 12: OpenGL Projects on SIMULATION OF WATER RIPPELS

User defined functions:

• calcwater()

• exit(int code)

• idle(void)

• motion(int x,int y)

Page 13: OpenGL Projects on SIMULATION OF WATER RIPPELS

Results

Page 14: OpenGL Projects on SIMULATION OF WATER RIPPELS
Page 15: OpenGL Projects on SIMULATION OF WATER RIPPELS
Page 16: OpenGL Projects on SIMULATION OF WATER RIPPELS

Cont Snapshots…

Page 17: OpenGL Projects on SIMULATION OF WATER RIPPELS

Conclusion & Future scope

The very purpose of developing this project is to exploit the strength of OpenGL graphics capabilities and to implement the concepts of simulations of water ripples on surface of water.

This package can be made more effectively for operators used in many computer languages like C, C++, etc, and can be made 3D.

Page 18: OpenGL Projects on SIMULATION OF WATER RIPPELS

References

Edward Angel –Interactive Computer Graphics- A Top –Down Approach Using OpenGL, Addision Wesley Publications 5th Edition in C-2009

The Official Reference Document for OpenGL Addison-Wesley Publishing Company

Page 19: OpenGL Projects on SIMULATION OF WATER RIPPELS

Source code on OpenGL Projects

THANK YOU