Unity to Scale

Using Unity to Scale Your Objects for VR

777 VIEWS

·

Scale is vital when building virtual experiences with VR. Without proper scaling, our virtual experiences can lead to disorientation and “simulator sickness” or just an overall bad experience. It can leave the project feeling unpolished. Scaling is often something that we don’t realize we need. It’s one of those common sense tools. Let’s consider for a minute the power that scale has over users and the VR environment.

Many times, developers will scale a virtual world to match the real world. A door will appear to be about seven to nine feet high in a virtual space, just as it does outside of VR, and the rest of the VR environment scales the same. Big, real life objects, then, appear relatively large in our virtual world. The opposite is also true. A house or a shoe rendered for VR, for example, would have the same proportions as they have in the real world. The environment would simulate a 1:1 relationship with our world.

In a recent project for Udacity’s VR Nanodegree, my task was just that—to design a room in our project that would be similar to the real world. My initial thought was to create this regular scene, so I created a basic scene with some objects.

Then I realized that I wanted to do something different. What if the virtual world was scaled way up? Rather than go with the expected “regular” proportions for everything, I decided that I wanted to go smaller. I wanted to explore other possibilities—another scale entirely. I wanted my users to feel small, so I surrounded them with really, really tall grass. I added a monstrous aluminum can to serve as the room.

My starting proportions look something like the picture below. The grass was really tiny, and the can was less than impressive.

I started with the can and scaled that up first. All Unity objects start out with a scale of 1, so I increased it to a uniform 2 and lowered my camera closer to the ground. When I loaded the project onto my phone for viewing in my cardboard holder, the result wasn’t what I wanted. The can was nowhere near big enough to be considered a room. I tried again. This time I increased the can’s scale to three. This time the results looked better, but I had to work on the grass next.

I decided that the width of a can, as we’d see it if it were laying in the grass, could be as tall as the grass. Or it could be a little shorter if the grass were taller. As I increased the scale of the grass, I needed to go much higher because it started out a lot smaller. It took some trial and error to play around with the numbers, but eventually, I created a scale that made it look like the can was a little shorter than the grass, and when I viewed it in my cardboard, I felt very short compared to the height of the grass.

The final result? While my project is still a work in progress, I can say that I’m pretty excited about it. Have you ever wanted to hang out inside your empty aluminum can? Here’s a sneak peek:

How to Scale:
For my VR apps, I’ve been using Unity.

Create a basic unity scene. Import some objects into your scene.

  1. Camera – Our camera doesn’t scale, even though it looks like it has a scale on it. (It’s a trap.)
  2. The environment – Using the scale on the Transform options panel under the Inspector tab, increase the x, y, and z by some number. If you use the same number in each, the object will scale uniformly. You’ll do this on each object in your environment.
  3. Alternative: If you’re using prefab objects, you can change the scale of the prefab objects before you start dragging them into your scene. This will save you time in the long run, as you won’t need to do this for every object individually.

The strategy: Enter your VR world often. As a general rule, I normally make a change to the environment and then immediately check it out. It’s much easier to fix one issue relating to scale when the problem is small. If you wait until much later to see your work on your device, you’ll spend significantly more time fixing things. The best way to test out your scale is to run a build and test it out, and get feedback on your work in progress as you go. I usually ask questions like, “Does this feel right?”, “Does that item look like it’s a correct size?”, or “Am I the right size?” etc.

This playing around with scale is something that seems to be lacking in the VR space. There are so many possibilities for virtual reality. We can be whatever we want. We can shrink or grow to see the world from different perspectives. We could shrink small enough to be blood cells swimming through veins, or grow big enough to hit an asteroid with a baseball bat. Why should we limit ourselves to the “normal” size of our world?

Do you think you can beat this Sweet post?

If so, you may have what it takes to become a Sweetcode contributor... Learn More.

Kristin is a freelance developer living in the San Francisco Bay Area. Her development background includes a mix of LAMP stack web development, Java and Android development, as well as Unity C# development. She is currently working on the Virtual Reality Developer Nanodegree from Udacity.


Discussion

Click on a tab to select how you'd like to leave your comment

Leave a Comment

Your email address will not be published. Required fields are marked *

Menu