## 4 Study of Augmented Reality and Possible Applications
### Case Study of the Hydraulic External Gear Pump with Unity and Voforia  
Two main tools were used for the implementation of DfD in AR: Unity software [24] and the Voforia libraries [25]. Unity is a GDE game development engine that allows us to create and export games to multiple platforms, e.g., desktop (Mac, Windows, Linux) and Web, and different marketplaces and devices (Windows, iOS, Android, Blackberry, Wii U, PlayStation, and XBOX). The software consists of a graphic engine, a physical one, and a live game preview for real-time visualization of the changes made to the game during the programming phase. Unity allows the creation of 3D video games and interactive content, such as three-dimensional animations in real-time. Being an integrated development environment (IDE), programmers are facilitated in programming the source code. The Unity programming language is called UnityScript and can be developed using two different languages: C# or Javascript. Voforia, on the other hand, is an SDK (software development kit) for applications in AR; it is, in fact, the most used platform in the world, able to offer fast and accurate image tracking. It represents a transversal solution to combine digital content with physical objects and environments. The tracker is the main part of Voforia; in fact, it analyzes every single frame captured by the camera to check whether or not it contains known image fragments (trackable) to associate with specific behaviors. Once Unity 2020 is installed on a PC and the use of Voforia libraries has been activated by inserting the license that can be downloaded for free from the proprietary site, the AR camera is activated and the Image Target database is imported, which can also be downloaded from the Voforia site. The chosen image (Figure 12) is also rated by the site on a scale of 1 to 5 stars based on how trackable it can be for the camera. The image chosen as the image target was downloaded from the Freepik website and evaluated by the Vuforia website as 5 stars out of 5 (Figure 13). To give stability to the digital object, the image must be defined as much as possible and have many contrasts between the colors to facilitate its recognition by its points/trackers. At this point, it is possible to import the entire mechanical assembly, designed in Creo and exported in obj (object) format readable by Unity, into the Hierarchy panel or every single component, taking care to keep as a reference for each its own axis of reference in order to be able to assemble everything again in Unity. With the case study presented, we decided to export the whole product in obj format directly from Creo Parametric and import it into Unity (Figure 14a,b). Figure 14: (**a**) Drive gear exported in obj form. (**b**) Hydraulic pump exported in obj form. Figure 12: Image target. Figure 13: Image target evaluated on the Vuforia website. The object, thus inserted in the project (Figure 15), must be made a child of the image target in order to be seen in augmented reality when the camera recognizes the image target as a marker. In fact, using the play button in game mode, it is possible to enjoy an AR replication on the PC monitor, useful for checking the changes that are made from time to time in the design. Everything that has been done so far allows us to view a static assembly, make it dynamic, and see the disassembly sequence in AR. An animation of the game object (i.e., the hydraulic pump) is created (Figure 16), which consists of the creation of a succession of movements defined by frames on a timeline. For each component, a keyframe (frame) is set in its initial position and another one in its final position to define its movement. This is possible because Unity is able to automatically obtain the intermediate frames, defined as tweens.