Search Projects

Tuesday, August 23, 2016

Fish Hunting OpenGL Project

We have seen Aquarium Program in OpenGL C/C++ where there are many fishes, which can eat food to grow and produce more fishes. Similarly there was poison which will reduce the population of fish in the aquarium, hence keep on the population check of fishes in aquarium.  Fish Hunting/Fishing is another project which will involve the fishes. This project is submitted by KARTHIK S HANDE and GAGANDEEP L M of AIT, CHIKAMGALUR. The Concept is very nice and evolves phases of time.
The Concept
The Project Concept includes the drawing of river, man with fishing bow, fishing boat, fishes in river and surrounding mountains which includes the sun. Man will board on the boat and put the bow in river with food to attract the fishes. Fleshes will get caught through the fishing rod.
Implementation
The project is implemented using the OpenGL Primitive functions and c++ methods. There are some methods defined to give functionality for drawing the objects. Each method has their own job of completing the project aim.  The extract code which will draw the sun is given below –
void sun()
{

int i;
 GLfloat a[30][3],theta=0,delta=2*M_PI/30.0,r=2.0;
 glClear(GL_COLOR_BUFFER_BIT);
 glLoadIdentity();
  glTranslatef(0.7,6+y,0);
  glColor3f(1.0,0.6,0.0);
  for(i=0;i<30;i++)
  {
 a[i][0]=d+r*cos(theta);
 a[i][1]=y+r*sin(theta);
 a[i][2]=0;
 theta+=delta;
  }
  glBegin(GL_POLYGON);
  for(i=0;i<30;i++)
 glVertex3fv(a[i]);
  glEnd();
}
Similarly there different methods functions for other objects.
This project also includes the pre information page or say front page in other words. In the front page the information like project name, projects developers, coordinators, guides and college name are displayed.  With help of menu functionality provided by OpenGL , menu implementation is done to start the project.
For the User Interaction the mouse functionality has been used. The mouse event is not much broader but only to start the fishing page and exit the program. More functionality can be added to the project along with the implementation of keyboard beside use of mouse.
Hope you will like this simple and attractive project. Add something from your side and submit to us we will publish the same by giving your name.

Download the source code!

No comments:

Post a Comment