The newest technologies make it possible to experience a virtual world in 3D. This can be done with an Oculus Rift but also with your own smartphone, using a Google Cardboard. Normally you need a lot of knowledge and some advanced programming skills to do these things. But we have made a step by step explanation to do this all by yourself: A manual for dummies!
If you want to model something for the oculus rift, there are two free programs: Unity and Unreal. Both are very good, but Unity is the only free program you can use for your phone too.
In this Instructable we will explain how you can load a 3D model of SolidWorks in a Google Cardboard app on an Android phone.
Step 1: Safe a SolidWorks As a .dae File
We will first create the object in SolidWorks. To open the file in Unity, you need to save it as a .dae file. Unfortunat you cannot directly save a SolidWorks file as .dae, so we need an extra program. Follow the 10 steps below to create an object, which can be opened in Unity. Keep in mind that the android phone must be able to run the final result, so do not make it more complex than needed.
1. Make an object in Solid Works. In our case it is a cute cube of 100 x 100 mm
2. Save the SolidWorks file as a .STL file
3. Download Meshlab on: http://sourceforge.net/projects/meshlab/files/meshlab/MeshLab%20v1.3.3/
4. Open Meshlab
5. Click on “File” and choose “Import Mesh...”
6. Choose your .STL file in click on “open”
7. If a screen pops-up. Choose “OK”
8. The cube will appear
9. Choose “File” and “Export Mesh as...”
10. Change the “Files of types” in a .dae file and click on “save”
Step 2: The First Use of Unity
Now we have saved our cube as a .dae file, we can import it in Unity. Unity is, like mentioned earlier, a program to create your virtual reality. A lot is possible, so try first to understand the options before you try to upload a very difficult environment.
In the following steps we will explain how to download the newest version of Unity and load our Cute Cube in the program.
1. Download Unity on: https://unity3d.com/get-unity/download?ref=personal and install the program
ATTENTION: During installation you will get a screen where you can choose some functions using checkboxes. You have to click on the “Android Built Support” to activate this function as well!
2. When your computer is finished installing Unity, open the program
3. The first time you use it, you need to fill in some information
4. Make a new account and login
5. Create a new project in 3D
6. Click on “Assets” in the taskbar and choose “Import New Asset”
7. Open the .dae file (see step 1)
8. The cube appears in the assets area on the bottom
9. Drag the cube into the scene
10. Now click on "File" and choose "Save Scene"
If you are interested in the functions, here is a short explanation of the different terms:
a) Scenes: They contain the objects of the game. When you make a game, think of each Scene file as a unique level. Scene are saved as assets.
b) GameObject: Every object is a GameObject. They can be a character, an environment or a special effect. See them as a container in which you can place components, which determine the characteristics of the object.
c) Components: These can be added to an object. Unity has a database with existing components but you can also create your own by creating script
For more information you can take a look at the manual at http://docs.unity3d.com/Manual/
Step 3: Install the Cardboard SDK
Now we need some extra functions and packages installed to load it on our mobile phone.
First you need to install the Cardboard SDK, so you can later create an application for a Cardboard.
1. Go to https://developers.google.com/cardboard/unity/download
2. You need to Download Cardboard SDK for Unity (see the first bulletpoint). Click on “direct link to unitypackage” to download it.
3. Now, open Unity again (if it is not still opened)
4. Choose “Assets” in the taskbar, choose “Import Package” and then “Custom Package”
5. Now select the 'CardboardSDKforUnity' package, you just downloaded three steps ago
Step 4: Install the SDK Tools
Now you need to install the SDK tools to make it possible to make a file that can be opened on your android phone.
1. Go to http://developer.android.com/sdk/installing/index.html?pkg=tools
2. Download the SDK tools by clicking on the blue coloured text: “download the SDK now”
3. During the installation you probably have to install Java as well. Install “Java SE Development Kit 7u79” on http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html. (choose Java 64x in the list)
4. Then, even if you have installed Java, for a weir reason it still looks like you have to find the Java program in your browser. You do not have to do this, just click on “next” and the installation will continue without any problems :) 5. Later on the installer will probably asks if you want to make a shortcut, it does not matter what you do here.
6. Finish the installation and open the SDK Manager
7. A screen appears in which you can check a lot of boxes. You should check the following boxes:
Underneath the “Tools” folder, you’ll want the following selected:
- Android SDK Tools
- Android SDK Platform-tool
- Android SDK Build-tool
Then, within the latest Android API folder (whichever is highest, at the time of writing that’s “Android 6.0 (API 23)”), choose the following:
- SDK Platform
- A system image
- Google APIs
Step 5: Place Your Camera and Create .apk File
The next step is to place the camera in the correct spot and to build the model to an .apk file that can be opened on your phone. Installing this .apk file on your phone will create an app which can be used with the cardboard.
1. You should open the cardboard folder in the asset list in Unity.
2. In the cardboard folder you can find a folder named ‘Prefabs’. Open this folder and drag the ‘CardboardMain’ object in the scene.
3. Now you can see the CardboardMain object in the hierachy list on the left. This object is the camera which is used to show your model. Placing this object in the correct place is therefore important. By dragging it around in your scene or adjusting the values in the transform component, you can place the object in the preferred place.
4. If you want to check if your model will be visible in the correct way, you can click on the play button. By pushing the alt key while using your mouse, you can look around in your model. If you are not content with the place of the camera, make sure to unpress the play button before moving the object.
Now the camera is placed, you can proceed to building your model.
5. Go to File → Build settings → Android → Player Settings.The player settings will appear on the right side of your screen.
6. In the player settings there are three things that need to be changed:
a) Under Resolution and Presentation you should change the ‘Default Orientation’ to ‘Landscape Left’.
b) By Other Settings you should change the ‘Minimum API level’ to the Android version of the phone that you will be using with the cardboard.
c) Also under Other Settings you can find the ‘Bundle Identifier’ which you should change into a self-made name. Make sure that it is written in the format ‘com.Company.ProductName’. For example, you can use the name: com.TfCD.Cube
7. Go back to the Build Settings and make sure that Android is selected. All boxes that are visible can be unchecked.
8. Click on build. You will get a window in which you can give the file a name and select a location.
9. Your .apk file is created!
Step 6: Install the App on Your Phone
During this step we are going to make your phone ready and install the created app!
1. Go to your phone settings and click on ‘Security’.
2. Here you can find an option for ‘Unknown Sources’. Enable this option. Tip: You might want to disable this option after installing the app to keep your phone secured.
Now we are going to place the .apk file on your phone.
3. Connect your phone with your computer using a USB cable.
4. Open the file manager of your phone on your computer and open your Download folder.
5. Copy the .apk file you have just created and paste it in your Download folder of your phone.
6. You can disconnect your phone from your computer now if you want.
Step 7: Enjoy Your Selfmade Virtual Reality Model!
The next and final step is now to install the .apk file on your phone.
1. Take your phone and go to the Download folder where you placed the .apk file. You can come here by clicking on the File Manager app on your phone.
2. Click on the .apk file.
3. You will be asked if you want to install the file.Click on install.
4. After installing, your phone might asks you if you want to delete the installation package. You can do this if you want.
5. Open the app that you just installed. This app can be found among your other apps.
6. Now you can see the cube you create!
7. Put your phone in the cardboard and enjoy your selfmade Virtual Reality model of your solidworks cube! Tip: if you don’t have a cardboard, you can buy one online or your can build your own by following this instructable: https://www.instructables.com/id/DIY-You-Virtual-R...
Step 8: What Are the Further Possibilities?
There are endless more possibilities. Think of more complex products or environments, the possibility to interact with the environment and walk around. You can explore the different functions and chances this new technology has to offer. And for example try out Unreal instead of Unity, or use an Oculus Rift instead of your phone.