Hole in One - VR GOLF GAME 

Byungil Jeong  and  Hye-yun Park

Summary

- The VR golf game in the CAVE

- Two player Game consisting of  3 Holes

- Implementation tool : YG

 

Story Board 

 

Snap Shots

   - Hole 1 -

 

   - Hole 2-

 

  - Hole 3 -

 

Features

1. Measurement of golf club head speed and collision detection between a golf club head and a golf ball

    I placed a transparent object on the golf club head and used "nodePosition" node to get its position. I made "clubPosition" node - modified nodePosition node to calculate club head speed. A nodePosition node is placed on golf ball to detect collision with club head and a clubPosition node is placed at the same position to track club head position and calculate speed.

2. Calculating projectile of golf ball using Euler method.

    At each step, calculate next position of ball based on current velocity and position of ball and next velocity of ball based on current acceleration and velocity of ball. Gravity, air drag, and ground friction are considered in this computation. When the ball collides with ground or trees, a damping factor is applied for calculating next velocity.

3. Collision detection among ground, trees, surrounding walls, and golf ball

    I referenced the source code of gravity node for this. CheckGround  function in the source code has a code fragment for getting intersection point of an object and a straight line. I used this code fragment to get intersecting point on ground, trees, and walls of rays from the ball position toward bottom, north, south, west, and east. By checking the coordinates of intersecting points, I can do collision detection.

4. Beautiful scenes - lake, snow field, christmas trees, and green field

    For modeling Hye-yun used Maya and Multi-Gen. Most textures are gained from pictures of real golf courses. Trees were modeled using small number of polygons, but still beautiful, so that program ran at high frame rate (about 50fps) which is very important for club speed detection.

5. Intuitive User Interfaces - graphical menu buttons, club selection menu, hole maps, score board

     I used an image object as each menu buttons which is placed under "pointAtPosition" node so that when an user pointing the button by want, wand events are delivered to the node. I used this method for all menu interfaces. I used text node to show scores on the score board.

6. Semi-auto navigation of golf car and drawing positions in the map

    I made "golfNavigator" node inherited from ygCaveNavigator. The golfNavigator receives new position of golf ball, rotates towards the position, and moves to the position. It's a semi-auto navigation because user movement may be stuck by trees, so user has to change the direction of navigation using joystick to avoid collision with trees.

7. User flying mode - hitting golf ball and flying to follow it

    I used teleport message of ygCaveNavigator for this feature. It's simple - teleport just behind ball position. Then, if user moves at the same speed as ball speed, he or she must feel sickness, especially, when the ball bounces on the ground. Thus, I slow down ball movement for this mode - about one fourth. By decreasing time step of Euler method below frame period, the projectile of ball doesn't change and only ball moves slowly. Actually the velocity of ball in the computation is same. The real position update period (frame period)  becomes bigger than the time step in the computation so that the ball moves shorter distance than before in each frame.

8. Slow motion mode - slowing down ball movement but the ball follows the same projectile as in normal mode

    I found hitting and seeing slow motion of ball is interesting experience impossible in reality. User flying and slow motion make this game not just reimplementation of real world, but VR.  I used the same method which is used for user flying mode. 

9. Different friction on green and other portion of hole

    I placed a nodePosition node (volume shape is cylinder) on green. When ball enter into the volume, the ground friction value is reduced.

10. Displaying Scores at the end of each hole

    When user put ball into hole, another nodePosition node on hole cup detects it and send messages to score board node to display scores so far.

11. Sound effects - hitting a ball, swing, and falling into hole cup

    I used ygSound node and play message is sent to it when each event occurs.

12. Two player mode - switching user

    I made playerControl node which holds the state of each player and ball. It decides next turn and navigation method according to user inputs.

 

Instructions for program running

    To hear sound effect, you need to change YG_SOUND_DIR in RUN file according to the directory you install this software.

    Then, execute program by following command.

    >  RUN hole.scene

 

User interfaces

1. You can skip first two intro pages by pressing the first(leftmost) button on wand.

2. Single player mode / Two player mode

    You may select game playing mode by pointing a menu button and pressing the first button on wand. If you select single player mode, the hole selection menu will show up. If you select two player mode, you will go to the first hole.

3. Hole Selection Menu : you can select a hole you want by the first button on wand

4. When you begin this game, you will see the club selection menu. You can select golf club by the second button. If you want to change club during game play, just press the second button. The club selection menu will show up.

5. The first button turn on/off hole maps during game play and the third button shows the game control menu.

6. Game Control Menu : you can select following functions by using the first button.

    Quit Game : quit game and go to the player mode selection page

    Start Over : Back to the beginning of current hole. When you lose ball or meet some unexpected situation, use this button

    Change Hole : When you want to go to other holes, it shows hole selection menu.

    Auto Navigation : It configure the navigation mode to auto navigation.

    Fly Mode : It configures the navigation mode to user flying.

    Slow/Fast : It toggles the ball movement mode : slow motion / normal motion

 

Possible Future Work

 1. More accurate measurement of golf club head speed 

 2. Adding wind effect

 3. Replay mode

 

Source Codes

 VR-Golf


last revision 12/03/04