Note that there are some explanatory texts on larger screens.

plurals
  1. POUse the iphone gyroscope with some animation and dirac LE
    primarykey
    data
    text
    <p>I'm trying to make an application with the same "goal" that Power Ball (for those who know what it is ;)</p> <p>When the player move his iphone from left to right, i use the gyroscope values to make some picture turn and change the speed/pitch of a music sample.</p> <p>Here is my issue : For the gyroscope it's OK For the music it's OK But for the animation i dont really know.</p> <p>I tried this method with NSTimer : </p> <pre><code>//Start the timer [timerRotationImage invalidate]; timerRotationImage = [NSTimer scheduledTimerWithTimeInterval:0.5 target:self selector:@selector(TimerRotateImage:) userInfo:nil repeats:YES]; //Make a picture turn with some angle uiImageRotate.center = CGPointMake(160, 140); angleRotation = angleRotation + 0.3; uiImageRotate.transform = CGAffineTransformMakeRotation(angleRotation); //For the acceleration/deceleration [timerRotationImage setFireDate:[NSDate dateWithTimeIntervalSinceNow:timerRotationImage.timeInterval / (uiDurationSlider.value*50)]]; </code></pre> <p>The thing is that sometimes at high speed the picture seems to be decelerating </p> <p>Could you give me other methods/More efficients ?</p> <hr> <p>For now i have tried some possibilities : </p> <ul> <li>This method with NSTimer and CGAffineTransformMakeRotation</li> <li>Another one with CALayer and CABasicAnimation </li> <li>And a last one with UIImageView and animation (with an array of image .jpg)</li> </ul> <p>What i am still not able to do is update the speed of the rotation/change it in real time. None of these methods are working =( need some help here !</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload