How I Brought a Coffee Can Into Virtual Reality Using Smartphone Photos
September 11, 2018
Intro: What is Photogrammetry, and Why Should You Care?
Creating 3D content for virtual reality projects can be a tricky process for anyone who is new to 3D modeling software. Advanced 3D modeling tools like 3DS Max or Blender allow people to achieve extraordinary realism, among other visual effects, but they have a steep learning curve. More simplistic tools like Tinkercad or even Minecraft make it easier to cook up 3D content, but you're limited in terms of the sorts of geometry and textures you can use when you create your models.
Typically, companies that want to use high quality 3D models and environments but who don't have a trained 3D artist on hand have two options: try to find high quality models on sites like Sketchfab and Turbosquid, or hire someone to do the work for you. This 3D modeling work is usually pretty expensive stuff.
Photogrammetry is the process of extracting 3D information from photographs, often for the purpose of generating a realistic 3D model that can be viewed from all angles. Photogrammetry software has taken extraordinary strides in the past decade, and last week I wanted to see just how far I could get using some of the simplest tools out there. I'm not a technical artist or software developer, and I was astonished at what I was able to achieve.
I'm convinced that photogrammetry is one of the easiest ways for non-technical users to create realistic 3D models for their virtual reality or visualization projects.
Hardware Used: My Samsung S8 smartphone. I expect any modern smartphone would do. For viewing in VR, I tried an Oculus Rift, HTC Vive, and Lenovo Explorer WinMR headset. They all worked fine.
Bringing the Coffee Can from Reality to VR: The Process
Here is the coffee can I used for this experiment. Here are the steps I did to bring it into virtual reality as a 3D model.
First, I downloaded and installed AutoDesk Recap. Because I have an educational affiliation, I was able to get a free Educator's license. If you don't have this, you can still try out the free 30-day trial. When you install Recap, make sure in the installer that you also install Recap Photo. When you open up Recap Photo and log in with your Autodesk account, you'll see a screen like this.
For this project, where I was generating a 3D model of an isolated object, I created an "Object" project. If you were doing fancy things with Drone footage and large scale mapping, you would do "Aerial". Once you select "Object", you'll be taken to a simple screen where the program asks you to upload a folder of photos. Now it's time to take photos of the object you want to turn into a 3D model. For this coffee can project, I used my Samsung S8+ smartphone. Have a better camera? Go for it.
I took the coffee can and put it on a white table and then started snapping photos with my phonefrom all angles, some close up and some far away. You want to get high quality photos all around the object, so make sure you position it so thatyou're able to maneuver your way around it.
This took a bit of trial and error, and I encourage you to watch this video from Autodesk and also keep these tips in mind:
Take lots of photos. The more data the software has to work with, the better the results
Try to capture the model in an environment where it has a fairly neutral background. If there's lots of clutter around the model, that clutter will be captured in your model and you'll have to do work later to remove it.
Make sure the item is well-lit
Items with very shiny or reflective surfaces will be more difficult to capture
Next, I transferred the photos from my smartphone to my computer and then uploaded the file of photos into my Recap Photo project and hit "Create". Recap Photo takes some time to process these photos, especially if you're on a free plan or trial. One time I did this and I didn't get a model back until the next day - another time it only took about 4 or 5 hours. Either way, don't expect to get your model back immediately. If you open up Recap Photo, you'll see an icon for your project and it will let you know its status. When it's done, you'll see a thumbnail of it in the "Cloud Drive" section of the starting screen of Recap 360 (see above).
When Recap is done processing the photos, you will see an option on the thumbnail of your Project to "Download the Project from the Cloud". Do that, and then you'll see the project appear in the "My Computer" section of the Recap starting screen. Open it up and you'll see the editor with the 3D model they've generated from your photos!
Recap Photo gives you a few simple model editing tools that will let you crop out any clutter that might be in the mesh. One of them is a sculpting tool that is pretty intuitive to use and lets you sort of shave off unwanted content. Experiment with the "slice and fill" tool and when you've removed clutter on the model successfully, hit "apply" and you'll see it trim off the unwanted parts of the mesh.
The icon below the "Slice" tool gives you an option to "Decimate" the mesh, which will reduce the size of the file and the "poly count" of the mesh, optimizing it for use in virtual reality. Decimating the mesh may have some impact on the visual quality of the mesh, but in my case I didn't notice a difference.
Once you have your model cleaned up, you can click the icon at the bottom of the menu and you'll see an option to export your project as a model. Doing so will download it as a .obj file with accompanying texture files. Now we're in the home stretch.
To bring our model into Virtual Reality, I'm going to bring it into Vizible. Vizible is our no-coding VR creation and conferencing software. You can download it here. In a nutshell, it lets people create virtual reality experiences with a drag-and-drop interface, and then view those experiences locally or meet inside of them with other people in VR for real-time communication and collaboration. The file format that works best in Vizible is OSGB, so we need to convert the OBJ model generated from Recap into an OSGB file. We make a tool that makes this easy for you called the Vizard inspector. You can access this tool by downloading Vizard here. Once Vizard is installed, search your computer for Vizard Inspector and open it up.
Drag your OBJ file into Vizard inspector and it will appear like so:
If you want to go the extra mile, select the texture of the model in the bottom left corner, and then apply compression to the texture. This will further reduce the file size and make it so that people accessing your VR experience can load it up faster. You'll see a Compression drop down available on the properties bar on the right when you have the texture selected. From the Compression drop down, choose "DXT1
Then, in Inspector you can go to "File" and "Save As". Give your model a title and save it out. This will save it as an OSGB file and it will be ready to go for Vizible.
Open up Vizible Presentation Designer and log in. Create a new blank Vizible Presentation and drag your OSGB model into your asset library. Then drag it from your Asset Library into the Scene View. Position it, scale it, and rotate it however you want. To make it so that people in VR can reach out and grab the model with their controls, right clicking on the model and select "grabbable". Here I am bringing the model into my Asset Library and then my Vizible Presentation.
When you've finished your Vizible Presentation (add as many models, photospheres, videospheres, images, documents, and sounds as you like!) you can publish your presentation as a session and meet others inside of it to show off your work. If you're new to Vizible, here's an article that shows you how to do that. It's easy.
Here I am inside of a Vizible session with my colleague Todd. I'm a WinMR headset and he's on desktop mode - Vizible works on WinMR, Vive, Rift, or Desktop PC. You'll notice that I have my model scaled up a little too much, so rotating it around wasn't as easy as it would be if it was smaller.