Parallax and the iOS 7 Wallpaper
Parallax and the iOS 7 Wallpaper
- By Rhett Allain
- 8:29 AM
Photo: Josh Valcarcel/WIRED
If you have updated to Apple’s new iPhone operating system (iOS 7), you might have noticed something different. When you are on the home screen, the icons appear to shift a little bit as you move the phone around. It’s sort of annoying and cool at the same time. It produces the illusion that the icons are floating above the background wallpaper.
This is a classic example of parallax (although this is fake parallax). You can create another example of parallax yourself. Hold you thumb out straight in front of your face at arms length. Now close one eye and find an object in the distance to line your thumb up with. Ready? Now switch the eye that was closed. Notice anything? Your thumb won’t be lined up with that distant object any more. Oh, you didn’t notice anything? Do it again and pay attention. Here is a diagram showing how a person’s two eyes see the thumb at different angles.
Different objects will have different angular shifts depending on their distance from the observation location. Here is an older post with some more pictures.
But is parallax useful? Yes. Parallax can be used to find the distance to some of the closer stars. As the Earth moves from one side of the Sun to the other (during a 6 month time interval), our observation location has shifted by twice our orbital radius. This shift is small compared to the distance to the stars, so it’s a difficult task. However, it can be used with some success.
Distance to the Wallpaper
For the iPhone, this is just a little tiny bit different than parallax. Normally, you have a known change in observation distance and then use the apparent change in angular position to find the distance to that object. In this case, the observation location (your face) doesn’t move. Instead, the phone tilts. However, this is exactly the same as if the phone was stationary and your head moved. A stationary phone makes for a simpler diagram.
Really, I don’t even need the top triangle in this case. I can measure the change in viewing angle and I can also measure the background shift (s1). If I assume the distance s1 is close to the same distance as the arc-length then the following would be true.
The greater the background shift, the further away it is from the front icons. How is this different from parallax in astronomy? In that case, you would measure the change in angular position and use the arc-length to find the observation distance. So, it’s mostly the same.
But how do I determine the value of s1? That’s fairly simple. I just measure it with a ruler and some screen shots. Here are two screen views at different angles.
Notice the shift in the red lines in the background (I took a picture of lines just so that this would be easier to see). If I use a real life ruler, the distance from the top red line to the bottom one is 4.4 cm. I can use this scale to measure the shift in one of the red lines. This measurement could be accomplished with a drawing program and converting pixels to cm or you could load this image into Tracker Video Analysis. For this case, I get a background shift of 0.31 cm.
What about the change in viewing angle? Well, it turns out that the compass app in iOS 7 has a built in angle measurement. Yes, it’s on the “second” page of the app. Now, it’s not perfect but I tried to hold the phone steady to switch apps. Here’s what I get.
For the other angle, I get a tilt of 46°. Let’s just call this a angle change of 90°. Now I can put my values in to get the distance from the background to the icons. Remember that I need the angle in units of radians instead of degrees.
That’s not too far back – and that’s a good thing. You know why? Because I made another assumption that I didn’t disclose. I assumed that the measurements on the background were the actual distances and not the apparent distances. Just image in the background was 1 meter behind the icons. If this were the case, my measurements wouldn’t really tell you the distance the background shifted. It would give the apparent shift. With a distance of just 0.197 cm, the difference between apparent and actual lengths is small enough to ignore.
You should probably repeat my experiment and see if you get the same values. Maybe you could find your own way to measure this background shift.
Here are some other things to consider.
- Since this is just an estimate, what is the uncertainty in the icon-wallpaper distance?
- How big of a parallax shift would there be if the icons were on the top of the front glass on the phone and the wallpaper was on the inside of the back of the phone (like an empty box)? For the iPhone 5, this seems to be a distance of about 0.7 cm.
- In my quick calculation, I just used two data points. What if you measured the background position for many different angles? What should a plot of wallpaper shift vs. angle look like? Does this phone parallax actually look like it should?
- For this example, I tilted the phone forward and backward. What about a side-to-side tilt? Does that have the same parallax effect?
- Here is the most important thing to do. Build some type of model of the icon-wallpaper system such that the wallpaper shifts just like the iPhone effect. You could probably reproduce this with a Lego background and lifted Lego icons.
Notice that I listed these as “further study” instead of my usual homework. This isn’t homework (though you can still do it if you like). These are notes to my future self so I can finish what I started.