I have a UIView that I am trying to convert (rotate) using the pitch value that you can get from the core. I use the transform, however, I'm not sure if my code is correct, as the UIView does nothing.
this is my code that gets called several times per second.
- (void)setLabelValueRoll:(double)roll pitch:(double)pitch yaw:(double)yaw { self.yLabel.text = [NSString stringWithFormat:@"pitch: %f", pitch]; CATransform3D transform; transform = CATransform3DMakeRotation(pitch + M_PI_2, 1, 0, 0); self.wapaA.layer.sublayerTransform = transform; }
Honestly, I'm not sure how to set this part (pitch + M_PI_2, 1, 0, 0) to make the pitch effect my UIView square, so I would suggest that the stop level is when you tilt the phone back and forth.
Any help would be appreciated.
source share