title: How to apply 3D moving background effect using gyroscope in ios
body: <p>I want to apply a moving background according to device orientation. If device is held vertically upright an it is rotated around y axis then the background should move left or right according to the value of rotation.</p>
  
  <p>Other icons on the background will static so it will give a 3d effect. For reference i need the exact same effect as shown in this video: <a href="http://www.youtube.com/watch?v=429kM-yXGz8" rel="nofollow">http://www.youtube.com/watch?v=429kM-yXGz8</a> </p>
  
  <p>The code i have developed till now is:</p>
  
  <pre><code>- (void)updateViewsWithAcceleration:(CMAcceleration)acceleration;
  {
      _accelX = ((acceleration.x* 0.1) + (_accelX*.9));
      _accelY = ((acceleration.y* 0.1) + (_accelY*.9));
      _accelZ = ((acceleration.z* 0.1) + (_accelZ*.9));
  
      [_backgroundShadow setFrame:CGRectMake(_accelY*50,_accelZ*50, _backgroundShadow.bounds.size.width, _backgroundShadow.bounds.size.width)];
      [_titleShadow setFrame:CGRectMake(_accelY*50, _accelZ*50, _titleShadow.bounds.size.width, _titleShadow.bounds.size.width)];
  
  }
  </code></pre>