Illustrations based kinetic textures in the form of an Interactive 3-D cricket game

 

Fellow collaborators:

Mr. Bhargav Balu, Undergraduate student, BITS Pilani Hyderabad Campus

 

This project was inspired from the work of the HCI group in NUS (click here) which received the best paper award at SIGCHI'14.

They had worked on bringing textures to live in a picture. We borrowed the idea of implementing kinetic motion and

thought of an application. We first implemented the floating bubbles animation as proposed (that was our minimal proposal then)

From there on we decided to implement the kinetic feature of direction & speed in an interactive 'cricket game'

 

Hence a cricket stadium was constructed using OpenGL libraries. We tried to replicate a real cricket field by making the elements

like bat, ball, wickets, pitch, ground, stands & side screen.

For the bat we used glucylinder and glusolidcube

for the ball we used a gluWiredSphere

the wickets were made using cylinders. all the other elements were made using polygons and quadilaterals at precise positions.

 

How: to play the game

The user can navigate through the stadium using various keypresses.

the possible navigation options available are: left right, up, down, roation along x,y,z axis.

Once the user is satisfied with the camera view the he/she right clicks on the screen to start the game

ball will be bowled automatically from the bowling end

the player bats and is given three different shorts using the 'left','right' & 'up' arrow keys.

Depending on where the bat key is pressed the shot is hit for a four, a six or a miss!

The ball

 

 

We have implemented the "equations of motion" for traversing of the ball.

The frame rate is set at a particular time and the screen is refreshed at regular intervals with the

updated position of the ball according to the equations of motion.

Balls are bowled in 6 different trajectories and any one of the trajectory is selected at random.

The camera view is always at the ball and this gives a feel of a real cricket game!

 

functions implemented:

 

kine() : a function that calculates the equation of motion for distanc and speed, the effect of gravity also taken into consideration.

selectball() : a function that chooses a bowlling trajectory

myinit():basics

animate():the heart of the code that defines the bowling region and the batting shot area

drawbubble():drawing the ball

batmove():bat shot selection

keyfunc():keypress coding

Mymouse():mouse clicks

cricketground():construction of the stadium

display():opengl basics