草庐IT

CATransform3DMakeRotation

全部标签

objective-c - iOS CATransform3D 坐标

非常感谢对此的任何帮助。我在一个View上应用了3D变换,需要识别渲染View的边缘坐标,以便我可以呈现另一个与其相邻的View(没有任何像素间隙)。具体来说,我希望通过动画角度将一系列View(“页面”)像传单一样折叠起来。intdir=(isOddNumberedPage?1:-1);floatangle=10.0;theView.frame=CGRectMake(pageNumber*320,0,320,460);CATransform3DrotationAndPerspectiveTransform=CATransform3DIdentity;rotationAndPerspe

ios CATransform3DMakeScale 放大动画

我有以下动画:CATransform3DscaleTransform=CATransform3DMakeScale(0.1,0.1,1.0);scaleAnimation.toValue=[NSValuevalueWithCATransform3D:scaleTransform];keyframeAnimation.timingFunction=[CAMediaTimingFunctionfunctionWithName:kCAMediaTimingFunctionEaseIn];;我正在缩小subview的位置。但我正在尝试做相反的事情。从subview大小的.01%开始,到subv

ios - 使用 CATransform3D 性能不佳

我正在尝试使用CALayer3d转换创建3D用户界面。我已经想出了实现这一点的基本技术,但我的实时性能很差。具体来说,用户应该能够以交互方式“平移”界面“场景”。在下面的片段中,“模型”是我要制作动画的图层。“相机”是一个CATransform3D矩阵,我通过应用触摸转换不断更新它。该方法有效,但平移非常缓慢。如果我使用CGAffineTransform取消注释该部分,我将获得快速响应的平移-但我将失去平移时应该发生的视角变化。-(void)didPan:(UIPanGestureRecognizer*)pan{if(pan.state==UIGestureRecognizerStat

ios - 使用 CATransform3DMakeRotation 平滑水平翻转

我设置了以下动画以在不同大小的View之间旋转。随着新的、更高的View进入视野,动画的中点似乎有一个闪烁。我可以做些什么来顺利过渡。newView.layer.transform=CATransform3DMakeRotation(M_PI_2,0.0,1.0,0.0);[UIViewanimateWithDuration:0.5delay:0options:UIViewAnimationOptionCurveLinearanimations:^{oldView.layer.transform=CATransform3DMakeRotation(M_PI_2,0.0,-1.0,0.0

iphone - IOS CATransform3DMakeRotation 需要矢量方面的帮助

我正在尝试制作翻页动画,并在互联网上找到了这段代码。这非常有效。它使页面从右到左翻动,就像一本普通的书一样。我想修改代码以使其从左到右移动,但我无法弄清楚向量和anchor是如何工作的。请注意我认为需要更改的这两行。我只是不确定要...viewToOpen.layer.anchorPoint=CGPointMake(0.0f,0.5f);viewToOpen.center=CGPointMake(viewToOpen.center.x-viewToOpen.bounds.size.width/2.0f,viewToOpen.center.y);CATransform3DendTrans

ios - 使用 CATransform3DRotate 制作动画

我的代码在下面,但是动画是立即发生的,即View不再可见:UIView*leftDoorView=[[UIViewalloc]initWithFrame:CGRectMake(0,0,self.view.bounds.size.width/2,self.view.bounds.size.height)];leftDoorView.backgroundColor=[UIColorgreenColor];leftDoorView.layer.anchorPoint=CGPointMake(0.0,0.5);[self.viewaddSubview:leftDoorView];leftDoo

iphone - 将逆 CATransform3D 应用于已转换的 CALayer 的子层

我正在使用CATransform3D转换将伪3D透视效果应用于View。我正在使用iPhone4中的陀螺仪来控制变换的参数。我正在转换的View有一些subview:结果是这样的:我的下一个任务是防止subview随着主视图的变换而变换,或者应用逆变换以使subview不受影响。我的目标是让每个subview垂直于父View,给人一种它们“站立”的印象。我用于转换的代码:-(void)update:(NSTimer*)timer{roll=[[[_managerdeviceMotion]attitude]roll];pitch=[[[_managerdeviceMotion]attit

iphone - 在 X 轴(水平轴)上旋转 UIView

我想将一个UIView在其水平轴上旋转360度,然后刷新View中的内容。我一直在寻找解决方案。在这里和那里找到一对夫妇。这就是我得出的结论。[UIViewanimateWithDuration:1delay:0options:UIViewAnimationOptionTransitionNoneanimations:^{self.tableView.layer.transform=CATransform3DMakeRotation(M_PI,1.0,0.0,0.0);}completion:^(BOOLfinished){NSLog(@"Finishedfirstpi");[UIVi

ios - 了解 CATransform3DRotate/CATransform3DMakeRotation

我正在尝试了解如何像这样为我的UIView创建深度感知:我试过这段代码:varrotationWithPerspective=CATransform3DIdentity;rotationWithPerspective.m34=-1.0/500.0/2/2rotationWithPerspective=CATransform3DRotate(rotationWithPerspective,22.5,0,1,0);preview.layer.transform=rotationWithPerspective生成透视图。然而,它出于某种原因翻转View。1)如何避免转换后的“翻转”?2)转换

ios - CATransform3DMakeRotation 和 CATransform3DRotate 之间的区别

我在看CATransform3DMakeRotation的官方文档和CATransform3DRotate我不明白他们有什么区别。有人在哪里使用CATransform3DMakeRotation以及在哪里使用CATransform3DRotate? 最佳答案 您可以使用4x4矩阵表示各种3D变换,包括平移、缩放、旋转、倾斜和透视。您可以通过将表示每个单独变换的矩阵相乘来在单个矩阵中表示多个连续的变换。CATransform3DMakeRotation创建一个表示单个变换的矩阵:围绕给定轴旋转给定角度。CATransform3DRot