From the course: Advanced iOS App Development: Core Animation

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Animating in 3D

Animating in 3D - iOS Tutorial

From the course: Advanced iOS App Development: Core Animation

Start my 1-month free trial

Animating in 3D

- [Instructor] Now that we've got a handle on how to create perspective and position layers in 3D space, we can get back to animating. For this example, we're going to rotate the time label negative 45 degrees on the y-axis, so that both party and time labels look like they sort of hinge off the middle of the screen. So under our multiTransform function, let's create a new one called animateLabel3D and we'll make ourselves some room. Now the first thing we need is our perspectiveTransform so we'll use our helper function and for this we're gonna use 800 to match the party time label. Once we've got our perspectiveTransform, we can modify it and rotate it like we've done before. So we'll use the CATransform3DRotate, we'll pass in perspectiveTransform as the transform parameter, for the angle we're gonna say pi divided by four, x is gonna be zero, y is going to be negative one, z is going to be zero. Now alternatively, we could definitely have said negative pi divided by four rotated…

Contents