4 Quick Start of SDK Access

Step1: New Project

Open Unity and create a new project:

_images/4.1.PNG

Figure 4.1 New Project

Create cube1, cube2 and cube3, and set their Transform positions to the following:

_images/4.2.png

Figure 4.2 cube1 Transform

_images/4.3.png

Figure 4.3 cube2 Transform

_images/4.4.png

Figure 4.4 cube3 Transform

Step2: Import SDK

Select the menu Assets>Import Package>Custom Package…

_images/4.5.png

Figure 4.5 Import of Custom Package

Dialog box will pop up, navigate to the appropriate directory and select “PicoVR_Unity_SDK- version number. Unity package” and click to open:

_images/4.6.png

Figure 4.6 Unity Package

After opening, a dialog box will pop up again. Please import the corresponding parts as required:

_images/4.7.png

Figure 4.7 Import options

After importing package, SDK will automatically set chapter 3.3 Default Orientation to be “LandscapeLeft” and V Sync Count to be “Don’t Sync”. Ensure boxes for the remaining settings are checked and click “Apply”.

Step3: Use SDK

Enter the Project tab, expand the Assets> PicoMobileSDK >Pvr_UnitySDK>Prefabs, drag the Pvr_UnitySDK parent object into the scene hierarchy, and set the Position and Rotation under the Transform component to (0,0,0):

_images/4.8.png

Figure 4.8 Directory of Prefabs under Pvr_UnitySDK

After adding it to the Hierarchy of the scene, the scene hierarchy should appear as shown in figure 4.9:

_images/4.9.png

Figure 4.9 Hierarchy of Scenes

Step 4: Delete Main Camera

To prevent other Cameras in the scenes from interfering with the SDK’s stereo rendering, delete the Main Camera shown in Figure 4.9.

Note: If there are multiple scenes in project, it is required to only add Pvr_UnitySDK in the main scene. Then by adding “DontdestroyOnLoad”, it can guarantee there is only one Pvr_UnitySDK prefab exists after scene loaded.

Step 5: Simulation run

Click the Run button to see the following in the Game window:

_images/4.10.png

Figure 4.10 Simulation run

Press Alt, move the mouse, and the picture will rotate up and down or left and right; Press Alt+, and click the left mouse button to select VR mode or Mono mode (Unity Editor only).

Step6: Packaging

Default tracking type is Headset 6Dof and Controller 6Dof. If type needs changing, expand “Only Rotation Tracking”, select “Only HMD Rotation Tracking” as 3Dof tracking and select “Only Controller Rotation Tracking” as Controller 3Dof

_images/4.11.png

Figure 4.11 Adapting target platform

When packaging, save the current scenes, then enter File>Build Settings, and click “Add Current” to add the current scene to the building list. select “Android” under Platform, then click “Switch Platform” and finally click “Build” to complete the packaging.

_images/4.12.png

Figure 4.12 Packaging

Specific SDK adaptation methods for various hardware products of Pico VR will be given in detail in the following chapters.