As anyone with experience in OpenSim knows perhaps the biggest barrier to having the general public view your work is the requirement to download a viewer and the complexity of using it once you have it downloaded.
Google Cardboard is a device that turns smartphones into stereoscopic, 3D viewers. Using the accelerometer and gyroscope built into the phone, the app also responds to head movements in 360 degrees.
While building our highly detailed 12,000-plus prim scale model of Detroit’s Michigan Central Station, we decided to do a simpler multi-platform sampler version for deployment in a variety of ways as a taster to persuade people to make the effort required to experience the full build. But we still wanted to keep it in 3D.
We created a smaller build, under 500 prims and with just 20 textures, so that it could be used as a display — for example, at last fall’s OpenSimulator Community Conference — and could also be realistically ported to other platforms like Unity 3D for embedding in a website and viewing with Oculus Rift and Google Cardboard for an immersion experience.
What follows is an brief explanation of how to make your OpenSim prim build viewable in Google Cardboard for Android.
What you need:
- your OpenSim build
- a free copy of Unity 3D development kit with Google Cardboard plugin
- an Android phone (iPhone deployment possible, but requires developer license)
- a Google Cardboard headset
Link up the prims in OpenSim into manageable size link-sets and then to export them as Collada mesh objects with textures.
The Singularity viewer does this quite will as long as you are the creator of both prims and textures.
Create a project in the free version of Unity 3D and import your newly created Collada objects into the Unity 3D scene.
In the video below, John “Pathfinder” Lester shows how to do this.
Add the Cardboard Plugin for Unity to your local Unity setup and build your new Unity “game.”
If you want your users to be able to move around inside the build, you will need to create some kind of movement mechanism. This is tricky, because users can’t touch their smartphones while they’re in the Google Cardboard headset, and tilting the smartphone is what controls the camera.
My solution was to put a red ball inside the scene. The user looks at the ball for a few seconds, and it triggers forward movement. Details about how I did this are in the white paper.
Configure your Android device to allow you to build and deploy your “game” to the device.
This turned out to be the trickiest part for me – damn Windows drivers!
Then find your new “game” icon on your Android device, click on it, put your phone inside the Google Cardboard headset, and enjoy.
If at any point you get stuck, a great place to get help is the Cardboard & VR Developers community on Google Plus.
Find your local hip coffee shop and just sit there moving your head around like an idiot looking in your Google Cardboard.
Pretty soon some one will ask you whats up and you can show them. After they get finished with the “Wow did you do this?”, you can start promoting your craft and explain how they should go on line and take a look at the complete build.
This article is adapted from a longer, more technical white paper about converting OpenSim builds to Unity 3D for Google Cardboard.
The virtual Detroit MCS sim can be reached by hypergrid at 3dcolab.com:9015. The company also hosts virtual Belfast, site of the popular live in-world music venue the Maritime Club.
Latest posts by Paul Emery (see all)
- View OpenSim builds with Google Cardboard - April 15, 2015
- Lessons from a public OpenSim demo for Oculus Rift - October 25, 2014