## 2 Materials and Methods
### Virtual Environment Design
#### 2.2.2 Virtual Scenarios  
Four virtual scenarios were designed as engaging games (Figure 3): Shapes, Supermarket, Fruit, and Building; all the scenarios have relaxing background music, auditory and vibrotactile feedback, which is provided when the virtual end-effector held by the patient collides with a virtual object. When the patients interact with the scenarios, they can see their score and a chronometer to know the remaining time and performance. All the scenarios present clues to help users complete an activity successfully; however, the system does not force the user to correct their movements. When the user starts the system, first, the instructions appear, then the user has to press the button in the haptic device end-effector to start the game, then the virtual representation of it appears in the center of the screen. For all the scenarios, if the user ends the game, a screen appears showing the score. In the Shapes scenario, the patient has to grasp and hold the real haptic device end-effector, and according to its movements, its virtual representation will replicate their movements. Then, to pick a virtual figure, the user needs to press the button (only once) located in the end-effector and move it to place it in the desired place. To drop the figure into the black hole with the corresponding shape, the user has to press the button one more time. The user gets an error when they put the figure over the black hole with a different shape. The difficulty of each level is different. In the first level, one of three different figures \begin{table}
\begin{tabular}{l l l l} \hline \hline \multirow{2}{*}{**Virtual Scenario**} & \multicolumn{3}{c}{**Movements**} \\ \cline{2-4}  & **Shoulder** & **Elbow** & **Wrist** \\ \hline Shapes & External and internal rotation, extension, and flexion & Extension and flexion & Extension and flexion & Extension and flexion \\ Supermarket & External and internal rotation, extension, flexion, abduction, and addiction & Extension and flexion & Extension and flexion & Extension and flexion \\ Fruit & External and internal rotation, extension, flexion, abduction, and addiction & Extension and flexion & Extension and flexion & Extension and flexion \\ Building & External and internal rotation, extension, flexion, abduction, and addiction & Extension and flexion & Extension and flexion & Extension and flexion \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Movements performed in each virtual scenario. can randomly appear: square, triangle, or pentagon; for the second level, a hexagon is added, and the figures displayed are smaller than the first level. The Supermarket scenario was designed as a game. The user moves the hand and presses the button to take a product; after that, the patient moves the hand over the supermarket cart and presses the button to drop it. Finally, the patient can move the supermarket cart across the hall by pressing the blue arrows that appear in the virtual scenario. According to the patient's condition, the scenario has three levels. In the third level, patients have to raise their arms higher than in the first level, and these movements are related to the products' positions on the shelves. In the first level, the products are on the middle shelf; in the second one, the patient has to take 12 products, one product of each type from the middle and high shelf, and finally, in the third level, the patient has to take products that appear in a checklist from all the shelf levels. The checklist appears in all the levels, but on the third level different products appear each time. The Fruit scenario has four levels. In the first level, the patient can move a big basket over the ground (without raising the arm); the fruit falls slowly, and a red guide indicates where the fruit will fall. When the guide collides with the end-effector, the patient receives vibrotactile haptic feedback. In the second level, the patient must move a small basket, the fruits fall faster along with the guide, but it will not vibrate when it collides with the end-effector.