2

Hi guys I am trying to rotate view on y,z axis I am successful with the following code but I want to rotate this on its end, now it is rotating from centre, I searched and I got anchorPoint property of layer to make it rotate but it makes unwanted translation of my view also it is not working

leftDoorView.layer.anchorPoint = CGPointMake(0.5,0);

// Code to rotate view on Y axis and slight translate on Z-axis
 angle -= 1.57f;
        [UIView animateWithDuration:0.5 animations:^{
            CATransform3D transloate = CATransform3DMakeTranslation(0, 0, -(leftDoorView.frame.size.width/2.0));
            CATransform3D rotate = CATransform3DMakeRotation(angle, 0, 1, 0);
            CATransform3D mat = CATransform3DConcat(rotate, transloate);
            leftDoorView.layer.transform = CATransform3DPerspect(mat, CGPointMake(0, 0), 500);
        }];

For more Info I want to make Menu effect like Taasky app any help will be really appreciated

Lachlan
  • 43
  • 4

1 Answers1

0

Perhaps the Ray Wenderlich tutorial about Taasky menu can help. Especially the "Adding Perspective to Your Menu" section.

For further information about animations, there is also documentation provided by Apple and nice anchor point explanation by David Ronnqvist.

David Rysanek
  • 901
  • 12
  • 16