Haptic Based Virtual Snooker Game
The setup consists of a computer and a Haptic device. The virtual game shows (see fig.1) a table with N(say 22) balls of different colors, one of which is the striker (white ball). A cue stick used to hit the white ball is shown in the figure. The ball can be aimed from any direction by moving the stick around the snooker table. We can move the stick around either through the key board or through the haptic interface. The position of the virtual camera changes accordingly. The virtual cue stick is used hit the striker through the haptic machine. The force of hitting the striker can be controlled directly through the machine. Once hit, the balls move around on the snooker/pool table and it can hit its sides as well as other balls, following the laws of physics. Besides this there are four pockets (changable based on the design of the game) in the table in which the balls can fall. Friction has also been appropriately modelled to reduce the velocity of the ball when moving. If the striker goes int the pocket it will be placed at a predetermined position. The game also has a sound track and during each collision (ball-to-ball or ball-to-wall) an appropriate sound is played via speaker for better immersion into the game by an user. There is a provision that the game can be restarted/reset at any given instant.
The code is written in C++ language and compiled through visual studio 2005. It can use upto three haptic devices, one device for the cue stick to hit the striker the second one to feel the force on the striker and the third one to feel the reaction force on an arbitrarily user selected ball. The additional two haptic devices are optional and are useful mostly for virtual/tele teaching purposes. The graphic rendering is through OpenGL on windows XP OS. Haptic rendering is through an API called HAPI from H3D. Haptic rendering require an update rate of 1Khz while visual rendering require only 30hz. Three different threads are used in the game for rendering graphic, haptic and sound channels The key idea is that through the haptic interface the gaming environment becomes more immersive and absorbing. The input is through the haptic device, when the user gets a good feel of the game and probably able to complete his/her daily quaota of physical exercise of upper arms. The fact that user gets a force feedback, allows the user to enjoy the game better