catransform3d

Core Animation - Page flip

ⅰ亾dé卋堺 提交于 2019-11-29 03:18:01
问题 I would like to 'bend' a view exactly like Flipboard app. I succeeded to flip an entire view, but not to bend it. My strategy is this: make a view/layer from half of the view I want to bend, add this to the view and flip this new view. So: how do I draw in a view/layer just half of another view? 回答1: Hey I recently used this code which works fine for me !!! You can get a flipboard like page animation with fold from center. It's concept is simple and it's easy to use. Just one class i.e .h .m

How to add image with parallax effect above UITableView header and keep header sticky?

时光怂恿深爱的人放手 提交于 2019-11-28 22:59:09
问题 Here is an image that explains everything I want to do: My question is, how would I make my view structure. The header of the table view should be fixed at top of the table. But what about the top most image that is above the table view header. Will I have to add the table view inside the UIScrollView ? Parallax effect can be done by CATransform3D , but how would I achieve what I want, that is my question. There are lots of demos but I want to make it done custom. 回答1: You can add image view

How to rotate an UIImageView with CATransform3DRotate make an effect like Door Opening?

折月煮酒 提交于 2019-11-28 19:38:21
I've read and try this article (Opening door effect using Core Animation) And I implement following code in my app: CALayer *layer = threeHomeView.layer; CATransform3D initialTransform = threeHomeView.layer.transform; initialTransform.m34 = 1.0 / -900; [UIView beginAnimations:@"Scale" context:nil]; [UIView setAnimationDuration:3]; layer.transform = initialTransform; CATransform3D rotationAndPerspectiveTransform = threeHomeView.layer.transform; rotationAndPerspectiveTransform = CATransform3DRotate(rotationAndPerspectiveTransform , 40.0f * M_PI / 180.0f , 0.0f , 1.0f , 0.0f); layer.transform =

How to rotate a flat object around its center in perspective view?

喜欢而已 提交于 2019-11-28 15:32:30
What I'm trying to do seems like it should be easy enough: I created a 2D top-down view of an old phonograph record. I want to rotate it (lay it back) in its X axis and then spin it around its Z axis. I've read every question here that has CATransform3D in the body, I've read Steve Baker's "Matrices can be your friends" article as well as Bill Dudney's book "Core Animation for Mac OS X and the iPhone" I think Brad Larson's "3-D Rotation without a trackball" has all the right code, but since he's permitting the user to adjust all three axis, I'm having a hard time shrinking his code into what I

How to get CATransform3D from Projection and ModelView matrices?

徘徊边缘 提交于 2019-11-27 23:13:00
all, I've got an iphone project that draws a 3D model using OpenGL-ES for a given model view matrix and given projection matrix. I needed to replace 3D model with CALayer, so I put values of model view matrix into CATransform3D structure and assigned it to layer.transform . It worked well, layer was visible and moved on the screen as expected, but after some time I realized that my layers behavior is not precise enough and I should take projection matrix into account. And then a problem appeared: when I simply concatenate two matrices my layer looks odd (it is very small, about 2 pixels, while

iOS: Simultaneous scale and 3D rotation animation

穿精又带淫゛_ 提交于 2019-11-27 13:30:38
问题 I made a video demonstrating the animation i'm trying to accomplish: Here it is. Notice the video illustrates the action as it would be seen from the side. The camera icon represents the user's POV. It's basically a simulation of a translation among the Z-axis accomplished though a scale transform, with a simultaneous independent two-step 3D rotation happening along the X axis. Looks and sounds simple enough, right? Wrong. Here's the ideal code, which doesn't work: [UIView animateWithDuration

How to rotate an UIImageView with CATransform3DRotate make an effect like Door Opening?

戏子无情 提交于 2019-11-27 12:26:32
问题 I've read and try this article (Opening door effect using Core Animation) And I implement following code in my app: CALayer *layer = threeHomeView.layer; CATransform3D initialTransform = threeHomeView.layer.transform; initialTransform.m34 = 1.0 / -900; [UIView beginAnimations:@"Scale" context:nil]; [UIView setAnimationDuration:3]; layer.transform = initialTransform; CATransform3D rotationAndPerspectiveTransform = threeHomeView.layer.transform; rotationAndPerspectiveTransform =

How to rotate a flat object around its center in perspective view?

独自空忆成欢 提交于 2019-11-27 09:18:37
问题 What I'm trying to do seems like it should be easy enough: I created a 2D top-down view of an old phonograph record. I want to rotate it (lay it back) in its X axis and then spin it around its Z axis. I've read every question here that has CATransform3D in the body, I've read Steve Baker's "Matrices can be your friends" article as well as Bill Dudney's book "Core Animation for Mac OS X and the iPhone" I think Brad Larson's "3-D Rotation without a trackball" has all the right code, but since

How to get CATransform3D from Projection and ModelView matrices?

Deadly 提交于 2019-11-26 23:16:52
问题 all, I've got an iphone project that draws a 3D model using OpenGL-ES for a given model view matrix and given projection matrix. I needed to replace 3D model with CALayer, so I put values of model view matrix into CATransform3D structure and assigned it to layer.transform . It worked well, layer was visible and moved on the screen as expected, but after some time I realized that my layers behavior is not precise enough and I should take projection matrix into account. And then a problem