# A Virtual Reality Simulator for Basketball Free-Throw Skills Development

Alexandra Covaci, Cristian-Cezar Postelnicu, Alina Ninett Panfir, Doru Talaba

► To cite this version:

Alexandra Covaci, Cristian-Cezar Postelnicu, Alina Ninett Panfir, Doru Talaba. A Virtual Reality Simulator for Basketball Free-Throw Skills Development. 3rd Doctoral Conference on Computing, Electrical and Industrial Systems (DoCEIS), Feb 2012, Costa de Caparica, Portugal. pp.105-112, 10.1007/978-3-642-28255-3_12. hal-01365575

HAL Id: hal-01365575

https://inria.hal.science/hal-01365575

Submitted on 13 Sep 2016

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# A Virtual Reality Simulator for Basketball Free-Throw Skills Development

Alexandra Covaci¹, Cristian-Cezar Postelnicu¹, Alina Ninett Panfir¹
and Doru Talaba¹

¹ Transilvania University of Brasov, Romania,
Department of Product Design and Robotics,
{alexandra.covaci, talaba}@unitbv.ro

**Abstract.** Basketball has grown into an international sport played and watched by millions of people. This paper describes the implementation of a virtual basketball accelerator. The main purpose of our study was to devise an application that could literary help players in practicing a free throw game indoors. In the development of this project we used Matlab, XVR and 3ds Max. The Matlab trajectory is simulated considering the development of a realistic behavior. The data acquisition from the trackers is adapted both for magnetic and optical markers, therefore extending its usability. The coordinates are then sent via UDP to the XVR environment, which draws the moving parts accordingly. The overall performance is improved by paying a great deal of attention to details.

**Keywords:** Skills, Virtual reality, Basketball simulator, Training.

## 1 Introduction

Virtual Reality (VR) is a sophisticated system, which utilizes and synthesizes different types of advanced high technology to produce a virtual world of multiple sense experience. The emergence of three dimensional (3D) virtual technology has brought tremendous changes in the world. VR can immerse people in an environment that would normally be unavailable due to cost, safety or perception restrictions. A successful VR environment provides users immersion, navigation, and manipulation [1], [2]. Burdea and Coiffet [3] described virtual reality as a simulation in which computer graphics were used to create a realistically-looking world that responded to user inputs. Applications to fields like entertainment, architecture, manufacturing art, medical, education and training have seen the effectiveness of this medium. The flexibility, reliability and adaptability of this environment are very much sought after, especially in education and training.

In the development of virtual environments (VE) for training, important aspects concerning the advancement of visual and haptic technologies can be analyzed in the context of sports training. Training environments provide offline and online information about athlete performance in the form of biofeedback [4], or transfer from the video game training context to performance in realizing real tasks [5]. Technology
improvements in visualization, motion capture, and computing power addressed challenges in the development of simulation VE for training sensorimotor components of sports [6, 7]. Providing augmented feedback to the learner is a common strategy to enhance motor learning. Augmented feedback provides information about movement characteristics that the user cannot elaborate without an outside source [8]. The augmented feedback can be provided in different ways – i.e. visual, auditory, and haptic feedback. Visual feedback has been successfully applied in many studies on complex motor tasks in sports and rehabilitation [9]. Thus, the proposed simulator was built to offer visual feedback meant to guide the user towards performance.

Implementation of sport simulators used in training purposes has been addressed in papers about rowing systems [10, 13], or other types of games like baseball or tennis. Basketball simulators exist mainly for entrainment [14]; their development doesn't aim to improve the skills of the players. This paper presents the implementation of a free-throw simulator that would provide not only a user-friendly interface, but also a modular program that could be expanded into more than a game towards a learning platform for people.

## 2 Contribution to Value Creation

The traditional concept of learning is based on the fact that the teacher is the ideal link and feedback in the transfer of knowledge necessary to perform an action. She should supervise, analyze, correct and motivate the user to carry out a specific task in the best way. The transfer of skill and knowledge (acquired from external events) to the brain comes in time, as the novice user repeats and comprehends the process [10].

Nowadays, the Human Machine Interfaces (HMI) have transformed the way communication, interaction and learning occur for the human being [11]. The perception level is extended and the learning process is accelerated by the means of these technologies. Basketball technique and tactics simulation based on virtual reality provides a new idea and teaching platform for modern training.

Additions like a force feedback system enhance the complexity of this application, turning it into an innovative training system. The proposed simulator can be considered an excellent tool to increase the quality and speed of learning and developing motor skills. It offers a wide range of aesthetics and performance features compared to the classic training systems and we intend to turn it into a commercial product for professional players. Future developments could also include incorporating other elements of basketball, such as dribbling and passing, in order to complete the simulator and turn the application into a full-blown game emulator making full use of the advantages offered by virtual reality.

## 3 Our Objective: A Basketball Simulator for Self-training

Programming a basketball simulator requires some key components, which influence its development:
* A realistic modeling of the ball and its behavior during flight, with forces like gravity, drag, wind and spin acting to change its trajectory.

* An exact determination of the shot accuracy and an estimation of a successful throw.

The ball can be considered to be a projectile and thus several forces must be considered when computing its trajectory. Among them, the ones that are most important are due to gravity, aerodynamic drag, wind and spin. All these parameters need to be evaluated in order to build a realistic simulation of a jump shot.

## 3.1 System Architecture

The architecture of the system includes 3D graphics, a motion analyzer and a motion capture system. Fig. 1 shows the relationship between each component. Matlab was chosen as the technical base for building the data acquisition system together with sampling and trajectory estimation.

The module provides two sets of independent variables, one representing the hand coordinates and the other the ball position, and another signaling set comprised of several control signals like valid throw or successful shot detection. All these are sent over the network using the User Datagram Protocol (UDP) to the XVR [12] application, which draws the two avatars and their movements together with the surroundings – the court, the backboard, and other realistic scenery - and also represents graphically the feedback information to the user – the score and the position relative to the origin, considered as the centre of the field.

<figure><img src="image_2.png" /><figcaption>Fig. 1. System architecture</figcaption></figure>

## 3.2 Tracking of Movement

In order to provide a suitable feedback throughout the training, it is necessary to capture and track the coordinates of the hand. This can be achieved by motion capture technology used in animation, movie production or sport performance analysis. We adopted first a magnetic capture system, which has been replaced with an optical
system because of its higher accuracy and shortest response time, essential for real-
time feedback to the users.

3.3 Feedback

Proper guidance can help students improve and learn effectively. Our proposed
learning tool provides visual feedback. This comes by the means of a score report.
Users are shown a general report about their performance. From this report, players
can get an idea about their evolution. If a throw is unsuccessful, on the screen will
appear the factor that was behind the fail: the direction or/and speed of the ball. The
offline analysis shows the user whether she should have thrown higher, lower, more
to the left, or more to the right, or whether the speed wasn't suitable for scoring. The
player is informed of these factors after each throw, having also available a history of
her past throws.

3.4 Matlab Implementation

The basketball simulator is built around the elements reviewed from existing game simulators and game programming books together with a feedback from what passionate users would expect in terms of coming close to reality, achieving presence and immersion. The key factors of simulating a jump shot divide the project into several sub-modules, where each one performs a specific task. The division allowed for parallel development and testing, thus achieving proficiency and independence, so that some parts could be re-used in developing other simulators for games like golf, tennis or handball.

The top module has two main parts. The first is a list of all constants and parameters that will be passed on to the separate modules. This is done so the simulator is easily adjustable to the three specifications of FIBA, NBA and WNBA, by choosing parameters related to ball area and mass. Also, the user can tune things like backboard material type by adjusting the value of collision restitution. Another two key parameters relate to speed and acceleration thresholds, which are used to determine whether a shot was made. The second part is made up of all the sub-modules that handle each task separately: a hand parameter acquisition module, a throw detection mechanism coupled to the trajectory estimation. Finally, all the relevant data is sent to the XVR module for graphic representation and rendering. Further, the involved Matlab modules will be described shortly.

The *HandParam* module is responsible for data acquisition and filtering.

The *ThrowDetect* module has two comparators for the current speed and acceleration of the hands. When any of these current values exceeds the defined threshold, a step signal is generated and it is passed to a sample and hold block. This means a throw has been made and the values of the position, speed, and acceleration at that point in time are sampled by means of the same sample and hold blocks that have as trigger the ThrowEnable signal.

One of the most complex blocks in the simulator is the *Trajectory* module. This module starts working at the exact same time a shot is detected and it computes the
movement equations on the three axes (x, y and z). This is done starting from the assumption that any object moving in the air can be treated as a projectile. The relations, which determine the trajectory of the ball while in mid-air, are related to Newtonian Physics and kinematics. Forces act both on translational and rotational components of the total acceleration.

The translational acceleration is obtained by computing the net external force on the object according to Newton's second law, where $F = ma$. The resulting value leads to computing the speed, $v$, and the position, $s$, of the ball at any time $t$, by solving the differential equations for translational motion:

$$ \frac{dv}{dt} = a. \qquad (1) $$

$$ \frac{ds}{dt} = v. \qquad (2) $$

All components are computed by splitting them into directional components. For this a Cartesian system is used where we consider the z-axis as pointing up, while the x and y-axis are parallel to the ground.

Our prototype draws trajectories using an ode45 solver and adds forces progressively to the mix. First, a gravity only model was shown. The next step was to implement the forces in Simulink and add them to the influence of the gravity only model. This was done by implementing several sub-systems in the Trajectory module, which computed independently the values of the other accelerations, a_magnus and a_drag.

# 4 Experimental Results

To validate the simulator and check its effectiveness in training basketball free throws we developed an experiment involving a number of 5 adult subjects, experienced basketball players. They were asked to shoot a number of 20 free throws using the simulator and afterwards a real basketball court.

The objective is to investigate the system performance from the following perspectives:

* Arousing Interest: Does the system motivate the users more eager to learn?

* Comparison with the Traditional Self-Learning Method: Does our system outperform the classical training system?

## 4.1 Arousing Interest in the Participants

The system is evaluated to check whether it is able to motivate the users in the learning progress. They were asked to complete a post training survey and afterwards
their answers were analyzed. The results show that our system is interesting and able to motivate players to learn. Some suggested that it would be more exciting if they know the highest score achieved by other players.

Another part of the post training survey is to find whether the system can provide an easy way of learning. From the survey, none of them thinks that the free throw motion is difficult to be performed and the most subjects are willing to recommend to other people to try the system. Overall, the subjects enjoy practicing free throws with our proposed system.

## 4.2 Comparison Evaluation

The participants (5 experienced basketball players) were asked to shoot 20 free throws in both real and virtual environments. In the virtual environment, they had an optical tracker H. 27 mounted on their right or left hand. On the screens of the CAVE they could see and correct their hand position in order to obtain a perfect shoot. After the 5 seconds necessary for setting up the simulation, they trained throwing the virtual ball towards the basketball hoop. The result of their throw was shown at the end, specifying either that they succeeded scoring or that they failed – with information on how should they throw next time.

Their results (the number of successful throws) were measured and the values are shown in Table 1.

<table><caption>**Table 1.** Free throw results</caption><thead><tr><td>User</td><td>Number of successful free throws in a real environment</td><td>Number of successful throws in the virtual simulator environment</td></tr></thead><tbody><tr><td>A</td><td>11</td><td>9</td></tr><tr><td>B</td><td>12</td><td>11</td></tr><tr><td>C</td><td>9</td><td>10</td></tr><tr><td>D</td><td>11</td><td>9</td></tr><tr><td>E</td><td>10</td><td>8</td></tr></tbody></table>

The analyze and interpretation of the results show a similar score for the successful throws both in a real basketball court and in the virtual simulator. One of the five users obtained slightly better results by the means of the proposed simulator. This illustrates the potential of the implemented system to guide the users in order to improve their skill in the learning process.

In the extra comments of the post training survey, all of them suggested that a force compensation mechanism should be implemented in order to feel de weight of the ball as it happens in a real environment.

Overall, this evaluation result supports the hypothesis that our system can assist players in free throw training. Combined with enhancements like a force feedback system that would actually provide the sensation of holding a physical ball, this
application would have the ability to become one of the most complex solutions available, performance wise.

In Fig. 2, we can see a part of the virtual environment, as it appears on a large screen, the hands of the user holding the ball. After 5 seconds, the user can see his hand movements in real time helping him to estimate the ball direction, and also the ball trajectory.

<figure><img src="image_3.png" /><figcaption>Fig. 2. The setup of the virtual workspace and the Matlab start simulation window</figcaption></figure>

# 5 Conclusions and Future Work

In this paper, we propose a basketball training system using the motion capture system is proposed. A virtual environment that simulates a free throw training court is provided to users who can train without a teacher. The experiment results proved the following contribution. First, professional players obtained in the virtual environment similar results to the ones from the real environment. Second, the users testing the system have expressed their opinion that it can be used for beginners and have appreciated the simulator as interesting and stimulating to learn.

As future work, haptic feedback is an extremely important feature to add on, in order to increase the reality provided by the system. To help the user immerse better, more visual effects will be provided. Moreover, more subjects, both beginners and experienced, will be invited to evaluate the system.

**Acknowledgments.** This paper is supported by the Sectoral Operational Programme Human Resources Development (SOP HRD), financed from the European Social Fund and by the Romanian Government under the contract number POSDRU/107/1.5/S/76945.
References

1. Hamit, F.: Virtual reality and exploration of cyberspace: Sams, (1993)

2. Heim, M.: Virtual Realism (1st ed.). Oxford University Press, Inc., New York, NY, USA, (2000)

3. Burdea, G.C., Coiffet, P.: Virtual reality technology (2nd ed.). New Brunswick, NJ: Wiley-IEEE Press. (2003)

4. Lieberman, J., Breazeal, C.: Development of a wearable vibrotactile feedback suit for accelerated human motor learning. In: IEEE International Conference on Robotics and Automation, pp. 4001--4006 (2007)

5. Rosser, J.C., Lynch, P.J., Cuddihy, L., Gentile, D.A., Klonsky, J., Merrell, R.: The impact of videogames on training surgeons in the 21st century. In: Archives of Surgery, 142(2), 181 (2007)

6. Bailenson, J., Patel, K., Nielsen, A., Bajscy, R., Jung, S.-H., Kurillo, G.: The effect of interactivity on learning physical actions in virtual reality. In: Media Psychology, 11(3), 354--376 (2008)

7. Bideau, B., Kulpa, R., Vignais, N., Brault, S., Multon, F., Craig, C.: Using virtual reality to analyze sports performance. In: IEEE Computer Graphics and Applications, 30(2), 14--21 (2010)

8. Sigrist, R., Schellenberg, J., Rauter, G., Broggi, S., Riener, R., Wolf, P.: Visual and Auditory Augmented Concurrent Feedback in a Complex Motor Task. In: Presence: Teleoperators and Virtual Environments 20:1, 15--32 (2011)

9. Ruffaldi, E., Filippeschi, A., Avizzano, C.A., Bardy, B., Gopher, D., Bergamasco, M.: Feedback, Affordances and Accelerators for Training sports. In: Virtual Environments PRESENCE, Mit Press, vol. 20, issue 1, (2011)

10. Ruffaldi, E., Sandoval, O., Filippeschi, A., Tripicchio, P., Frisoli, A., Avizzano, C.A., Bergamasco, M.: Integration of Multimodal Technologies for a Rowing Platform. In: Proceedings of the 5th IEEE International Conference on Mechatronics, Malaga, Spain, (2009)

11. Sharma, R., Pavlovic, V., Huang, T.: Toward Multimodal Human-Computer Interface. In: Proceedings of the IEEE, vol. 86, no.5, pp 853--869, (1998)

12. XVR development environment, http://www.vrmedia.it/Xvr.htm

13. Rauter, G., Zitzewitz, J., Duschau-Wicke, A., Vallery, H., Riener, R.: A tendon-based parallel robot applied to motor learning in sports. In: Proceedings of the 2010 3rd IEEE RAS & EMBS, Tokyo, Japan, (2010)

14. Zhang, L., Wang, L.: VR-Based Basketball Movement Simulation. In: Transactions on Edutainment V, Publisher: Springer Berlin, (2011)