Interactive Golf Game Development in Virtual Environment

DOI : 10.17577/IJERTCONV3IS15026

Download Full-Text PDF Cite this Publication

Text Only Version

Interactive Golf Game Development in Virtual Environment

R. Priyadharshini1*, M. Madhu2 and K. Anu Rekha3

1, 2 &3 Department of Production Engineering, PSG College of Technology,

Coimbatore , India

Abstract An interactive golf is developed which can help the users to get fully immersed in virtual environment. It fulfills the requirements of the original game. The players can get more practice when playing in the virtual environment. To implement this project, the requirements are golf club, golf ball and golf environment which are modelled by using 3ds Max software. The modelled objects are imported in to vizard and finally collisions are detected between club and ball.

Keywords: Virtual reality, golf course, golf ball, golf club, collision detection

    1. Virtual reality

      1. INTRODUCTION

        Figure 1.2 Transmitter

        Virtual Reality is a field of study that aims to create a system that provides a synthetic experience for its user. The technology provides us a three dimensional, immersive and fully interactive visualization environment. To simulate and generate virtual experiences, developers often build a computer model, also known as virtual world or virtual environment which are, for instance, spatially organized computational objects, presented to the user through various sensory display system such as the monitor, sound speakers, and force feedback devices.

        The graphics processing power of home computers increase Virtual Reality applications become more and more viable for a number of uses. User interfaces in many such applications today require the user to have a fairly high degree of skill. This report describes a project creating navigation controls and a graphical user interface for a Virtual Reality application aimed at users at the beginner level. The report details the design of a number of

        tools available in the application as well as results from user testing with prototype versions. The result of the report is a combination of the prototypes tested to form a fully functioning user interface.

    2. Transmitter

      The transmitter is a tracking device that allows a virtual reality system to monitor the position and orientation of selected parts and to generate corresponding response to the virtual world.

      In terms of hardware, the following three components are generally required a source that generates a signal, a sensor that receives the signal, and a control box that processes the signal and communicates with the computer.

      The usefulness of tracking devices in virtual environments depends to large degree on whether the computer can track the movements of the user fast enough to keep the virtual world synchronized with the user's action. The signal lag is the delay between the change of the position and orientation of the target being tracked and the report of the change to the computer. The update rate is the rate at which measurements are reported to the computer. Typical update rates are between 30 and 60 updates per second.

    3. Kinect

      Kinect is used to control interactively an armature by tracking body poses. Animators can animate virtual characters in real-time by their own body poses, thus obtaining realistic and smooth animations. The proposed interface allows animators to save time with respect to the traditional animation technique based on key framing. Different examples are used to compare the Kinect-based interface with the key framing approach, thus obtaining both an objective and a subjective assessment.

    4. Golf game

      Golf is a precision club and ball sports in which competing players use many types of clubs to hit balls into a series of holes on a course using the fewest number of strokes. Golf is defined, in the rules of golf, as "playing a ball with a club from the teeing ground into the hole by a stroke or successive strokes in accordance with the Rules."

      1. Rules of the game

        Two types of play in golf game environment,

        1. Stroke play-single player and nine holes

        2. Match play-dual players and 18 holes

          The objective is to use as few stroke as possible in playing all the holes.

      2. Golf game problems in real life

        It requires large amount of area and expensive. Due to increase in the population, there is a rapid growth in urbanization. Cities will expand their current boundaries, and absorbing land for living. Golf Game takes four-to-five hours to complete one round. Number of holes reduces, depending on the availability of physical land. Only rich people can be as home-grown golfers, as it is expensive as well as exclusive.

      3. Need of virtual reality

The virtual reality (VR) technology provides a three-dimensional, immersive and fully interactive visualization environment. Virtual Realitys primary benefit is being able to teleport the player to any environment; to any time and any place. This freedom is especially important for those with limited mobility. Virtual reality golf game has become a cheap alternative for many who can't afford to play on outdoor courses.

3. MODELING

    1. Modeling the golf ball

      The diameter of the golf ball is about 42.67 mm and its weight is about 45.93 grams. It is made up of firm core covered by the multiple layers of soft cover.

      To model the golf ball, the sphere option is selected and drawn the sphere with radius 2.29 cm which follows with the hexagonal shape is created for generating the exact shape of the golf ball using 3ds Max. The following figure 9.1 shows the golf ball.

      Figure 3.1 golf ball

    2. Modeling the golf club

There are many different types of golf club made of woods and irons. It depends on the variety of shots. The outer angle of the golf club is 60and the length of the golf club is greater than or equal to 18 inches.

  1. METHODOLOGY

    1. Game system

      The golf game is a computer-based 3D game with the hardware device using a club. Thus this game can provide great realism to the players. The interfaces of the golf games are designed carefully to simulate the real game conditions. So players can enjoy the merit of familiar movements.

      The system is divided into three parts,

      1. Software development

      2. Hardware interaction

      1. Software development

        The physics engine consists of the following parts,

        1. Striking the ball

        2. Friction of balls with the ground

        3. Collision detection

        4. Collision response

      2. Hardware interaction

        The hardware devices such as,

        1. HMD

        2. Transmitter

Figure 3.2 golf club

Using 3ds Max, the golf club was modeled by selecting the line loop option with the particular length and the club handle is tilted 60 degree angle.

Figure 3.3 golf club

    1. Modeling the golf course

      According to the details that were collected about golf course modeling it in 3ds max would be more realistic and reliable so in this project the modeling of golf course shall be done in 3ds max. The steps that are followed to create a realistic golf course are as follows.

      1. Initially the plane was selected. The ups and downs that are to be present in the golf course are made with the help of options such as push and pull in edit poly tab are being used.

      2. To differentiate various hazards such as sand, water, rees etc the appropriate properties are being applied at those particular places.

      3. With the help of cylinder option and Boolean operation 9 holes are made in the golf course at different places. Then in order to indicate all the holes, flags are designed and placed near them with numbers indicating their positions.

      4. Finally relevant texture is applied to the golf

        course.

        The following figure 9.4 shows the golf course

        Figure 3.3 golf course

        1. SIMULATION

          For golf game simulation, the golf ball copy has been made and also carried out by some physics technique. Then the golf club covered by bounding box for easy to calculate the collision when the golf ball and golf club meet. The bounding box also covered the target hole of the golf game in which the bounding box is invisible.

            1. Importing into vizard

              The developed models are imported into the vizard software and positioned the models in appropriate place with respect to x,y,z axis. In order to import the developed models in vizard software, the model should be converted into .osg or .wrl format.

              The golf ball, golf club and golf testing environment are added by the following code, ball=viz.addChild('vizball.wrl',scale=(0.005,0.005,0.005),c ache=viz.CACHE_CLONE) ground=viz.addChild('golfenv2.osgb') b=viz.addChild('golfbat.wrl')

              The following figure 4.1 shows the imported models.

              Figure 4.1 Imported Models

            2. Interaction provided

              To capture the 3D skeleton of the golfer while swinging the golf club, transmitter is used. Basically, the transmitter is a tracking device which allows a virtual reality system to monitor the position and orientation of selected parts and to generate corresponding response to the virtual world. Tracking devices, also called 6-degree- of-freedom (6-DOF) devices, work by measuring the position (x, y, and z coordinates), and the orientation (yaw, pitch, and roll) with respect to a reference point or state. The tracking was performed, only for the golf club part. For that purpose, the transmitter was connected to the golf club which could easily track the 3D skeleton of the golfer while swinging the golf club. In order to convert the real time position into the screen coordinate, the vrpn server was connected to the vizard software.

            3. Connecting transmitter to computer

              Before using the plug-in, establish a connection to the transmitter using cable. For connecting transmitter the following code is used,

              importviztracker vrpn=viz.add('vrpn7.dle')

              track1=vrpn.addTracker('Tracker0@cad43',0) viz.link(track1,a)

              #vizshape.addAxes() a.enable(viz.COLLIDE_NOTIFY)

            4. Enabling physics

          The movement of the ball depends upon the motion, force that is given by the golf club and the friction that is found in the golf plane. All these properties are being carried out by enabling physics in vizard.

          To enable the physics the following code is used, viz.phys.enable()

          ground=viz.addChild('golfenv2.osgb') ground.collidePlane() ground.disable(viz.DYNAMICS) viz.collision(viz.ON) b=viz.addChild('golfbat.wrl') b.collideBox()

          b.density = 0.8

          b.bounce = 0.5

          4.5. Collision detection and response

          The invisible bounding boxes were created for cover the objects. Using these boxes can easily calculate the collision detection and response between the objects while playing the game. To detect the collision the following code is used

          box1=viz.add('box.wrl') box1.collideMesh() box1.disable(viz.DYNAMICS) box1.disable(viz.DEPTH_WRITE) defonCollideBegin(e):

          if e.obj1 == b:

          print 'collision detected! for ball' if e.obj2 == box1

          ball.disable(viz.DYNAMICS) ball.disable(viz.DEPTH_WRITE) ball.disable(viz.COLOR_WRITE) textScreen=viz.addText('GAMEOVER',parent=viz.ORTH O, fontSize=50)

          viz.collision(viz.ON)

        2. RESULT AND DISCUSSION

          In order to implement augmented reality and virtual reality cad models are being modeled and they are imported to vizard and the processes are being carried out.

        3. CONCLUSION

The objects have been modeled using 3ds Max software as golf ball, golf club and golf course. These models were imported into vizard software. To track the position of the club, the transmitter was used whenever the golfer swing the golf club that has been tracked and replicate the corresponding action in the virtual world. This type of golf game is highly interactive with the user. Now days, this type of games are generated by the game industries.

REFERENCES

  1. A. Green, B. Red and C. Blue The title of the book. 1st edition, Publisher, 2001.

  2. A. Green, B. Red and C. Blue The title of the conference paper. Proceedings of Conference Title, where it took place, Vol. 1, paper number, pp 1-11, 2004.

  3. A. Green, B. Red and C. Blue The title of the journal paper.

Journal Name, Vol. 1, No. 1, pp 1-11, 2006.

ACKNOWLEDGEMENT

The authors thank PSG College of Technology, Coimbatore, India, for motivating and rendering technical support to complete this project

Leave a Reply