catransform3d

3D Door Open Animation between two UIViewControllers

南笙酒味 提交于 2020-01-10 09:21:48
问题 This has been asked before, but there is no sample code to be found on stackoverflow and no proper solutions as far as I'm aware. I have a solution, but it looks crap. I'd be grateful for any input and modifications to get a more realistic 3D door open / book cover animation. Aim is to have an animation between UIViewControllers so that you get the effect as if you were opening a door or a book cover. ViewController 2 is static and in the background. Above it you place ViewController 1 which

3D Door Open Animation between two UIViewControllers

故事扮演 提交于 2020-01-10 09:21:12
问题 This has been asked before, but there is no sample code to be found on stackoverflow and no proper solutions as far as I'm aware. I have a solution, but it looks crap. I'd be grateful for any input and modifications to get a more realistic 3D door open / book cover animation. Aim is to have an animation between UIViewControllers so that you get the effect as if you were opening a door or a book cover. ViewController 2 is static and in the background. Above it you place ViewController 1 which

Objective-c CATransform3DMakeRotation Clockwise/Counterclockwise

痴心易碎 提交于 2020-01-03 04:46:26
问题 I'm rotating an UIView along the x axis using CATransform3DMakeRotation using the below code: float radians = DegreesToRadians(30); [UIView animateWithDuration:0.15 animations:^{ self.moveControlView.layer.transform = CATransform3DMakeRotation(radians,1,0,0); }]; The rotation is applied always in the same versus ( clockwise ). I want to rotate the UIView in the opposite versus. In order to achieve my goal I've tried: Set a negative angle (-30) Set the angle to 330 But the versus of the

How can I draw and rotate an Arrow at an Orientation in 3D Space?

≡放荡痞女 提交于 2020-01-02 18:55:38
问题 I want to draw an image like the following in a certain orientation. Assume that the device lies flat on a table the image above shows how the arrow should be drawn. The angle between the device and the table is called alpha and it is zero in this case. The arrow points straight to a predefined location point. If you rotate the device on the table the arrow will point alway to the target direction just like a compass. I did the update of the image position with the following code in 2D space:

CATransform3dTranslate issue in imageView

我是研究僧i 提交于 2019-12-25 16:01:32
问题 i have a problem with CATransform3DTranslate. i concatenating it with CATransform3D with the code from KennyTM here i measured the coordinate using Photoshop. here is my complete code : background.image = UIImage(named: "backgroundtest") gambar.image = UIImage(named: "imagetest") gambar.layer.anchorPoint = CGPointZero var translate = CATransform3DIdentity translate = CATransform3DTranslate(translate, -160, -85.5, 0) var perspective = CATransform3DIdentity perspective = compute_transform

On iOS, why does setting a layer's sublayerTransform turn itself to act like CATranformLayer?

别来无恙 提交于 2019-12-20 10:47:20
问题 It is known that the zPosition of the layers only determines which layer cover up which layer. Whether it is a zPosition of 10 or 1000 won't affect its position. That is, unless if we use CATransformLayer to contain those layers, then the zPosition of those layers will affect the layers' position. However, the following code running in iOS 5.1.1 does make the zPosition alter the position of the layers... you can try it in a new Single View App, and add the following code to ViewController.m .

Need better and simpler understanding of CATransform3D

对着背影说爱祢 提交于 2019-12-20 08:18:46
问题 Please go through the images. So this is the code which I got from some online source and it does transform my object. Besides that, I understood nothing at all. I am new to CATransform3D and want to know exactly how it works. CATransform3D transform = CATransform3DIdentity; transform.m34 = 1.0 / -500; transform = CATransform3DRotate(transform, 45.0f * M_PI / 180.0f, 0, 1, 0.0f); _bgView.layer.transform = transform; I want to know how did this code run? Why did we set some value in m34? I

Could I get a basic explanation of CATransform3DIdentity?

倾然丶 夕夏残阳落幕 提交于 2019-12-19 02:34:06
问题 I am slowly getting more serious about Core Animation and would greatly appreciate an explanation composed of short words spoken (typed?) slowly explaining CATransform3DIdentity and why the following code does what it does (flips the layer around in '3D' space) kFaceUpTransform = kFaceDownTransform = CATransform3DIdentity; // Construct a 180-degree rotation matrix: kFaceDownTransform.m11 = kFaceDownTransform.m33 = -1; On second thought, type quickly and use multisyllabic words to your hearts

meaning of m34 of CATransform3D

*爱你&永不变心* 提交于 2019-12-18 10:24:43
问题 What's the meaning of m34 of the structure CATransform3D, I only know it can change the perspective, but what's the meaning when the value is -0.001 and 0.001? 回答1: You can find the full details here. Note that Apple uses the reversed multiplication order for projection (relative to the given link) so all matrix multiplications are reversed and all matrices are transposed. A short description of the meaning: m34 = 1/z distance to projection plane (the 1/e z term in the reference link) + for

iPhoneSDK calculate Rotation angle from CATransform3D

这一生的挚爱 提交于 2019-12-18 10:24:10
问题 How do I calculate the Rotation in Radians around Z-axis by giving a CATransform3D struct as the input? basically what I need is the other way round of CATransform3DMakeRotation . 回答1: It depends on what axis you are doing the rotation on. Rotation about the z-axis is represented as: a = angle in radians x' = x*cos.a - y*sin.a y' = x*sin.a + y*cos.a z' = z ( cos.a sin.a 0 0) (-sin.a cos.a 0 0) ( 0 0 1 0) ( 0 0 0 1) so angle should be a = atan2(transform.m12, transform.m11); Rotation about x