catransform3d

UIView with CATransform3D inside a UITableViewCell = Choppy Scrolling

▼魔方 西西 提交于 2019-12-06 05:42:17
问题 I'm using a custom UITableViewCell , into which I am placing a subclassed UIView (within contentView , natch). The UIView in question displays a directional arrow and two lines of supporting text. The arrow is displayed by means of a layer with a background color and an arrow-shaped mask. The background color changes to one of two possibilities depending on the direction the arrow is pointing. The view receives a NSNotification whenever it needs to update the arrow (based on, but not

Converting OpenCV's findHomography perspective matrix to iOS' CATransform3D

拜拜、爱过 提交于 2019-12-06 05:13:44
问题 I'd like to take the perspective transform matrix returned from OpenCV's findHomography function and convert it (either in C++ or Objective-C) to iOS' CATransform3D . I'd like them to be as close as possible in terms of accurately reproducing the "warp" effect on the Core Graphics side. Example code would really be appreciated! From iOS' CATransform3D.h: /* Homogeneous three-dimensional transforms. */ struct CATransform3D { CGFloat m11, m12, m13, m14; CGFloat m21, m22, m23, m24; CGFloat m31,

How to make a CATransform3dMakeRotation rotate the other way? And chain together

旧城冷巷雨未停 提交于 2019-12-06 04:22:41
问题 I'm working with some Core Animation for the first time and in the process of implementing a playing card that I can flip around, I've decided to use a CALayer to display the contents (not sure how I'm going to get two sides, but that's another question) and I need to be able to flip it over, move it, etc... I'm using CATransaction with some success - in the snippet below, the card moves from the bottom left to the top left and flips over. The problem is that I wan't it to flip the opposite

Using CATransform3D to create flip animation

感情迁移 提交于 2019-12-06 03:21:51
I'm trying to recreate UIViewAnimationTransitionFlipFromRight (and left). My reason for doing so, as shown below, is to make changes to AVCaptureVideoPreviewLayer in the middle of the animation, when the layer is obstructed. UIViewAnimationTransitionFlipFromRight won't let me stop the animation half way, make session changes, and continue, so here is my best shot at it. While this works, it's just not the same as UIViewAnimationTransitionFlipFromRight. The layer starts to rotate, but more of a slide, backwards and diagonally (very hard to describe), and then reverses for the second part of the

CATransform3DRotate with m34 parameter need to know angle to fit specific height

ε祈祈猫儿з 提交于 2019-12-04 19:30:49
I have the following transform code: //preparing transform CATransform3D basicTrans = CATransform3DIdentity; basicTrans.m34 =1.0/-projection; //calculating angle double angle= [[self angleValueForBlockHeight:height] doubleValue]; double rangle; if (up) { rangle=angle/360*(2.0*M_PI); } else { rangle=(360.0-angle)/360*(2.0*M_PI); }; //NSLog(@" angle: %g", angle); //transforming bView.layer.transform = CATransform3DRotate(basicTrans, rangle, 1.0f, 0.0f, 0.0f); As you can see I'm rotating bView using specific angle to have a value of height variable after rotation. And as you can see I have a

3D Cube Problem! Part 1

…衆ロ難τιáo~ 提交于 2019-12-04 13:20:35
I have created a 3D cube in iphone using CALayer's . Now I wanted to rotate that cube( CALayer ) at 90˚ when user double taps on it. I was able to rotate that cube( CALayer ) to 90˚ once but when I double tap the cube( CALayer ) is not rotating. Here is the code that I used to rotate the cube( CALayer ) CATransform3D x = CATransform3DRotate(currentLayer.sublayerTransform, M_PI / 2, 0, 0, 1); currentLayer.transform = x; Can anyone help in this. What I'm doing wrong. PS. For the people who are wondering how I got the degree sign then here is the trick Option + K its because you are not changing

Converting OpenCV's findHomography perspective matrix to iOS' CATransform3D

回眸只為那壹抹淺笑 提交于 2019-12-04 12:50:58
I'd like to take the perspective transform matrix returned from OpenCV's findHomography function and convert it (either in C++ or Objective-C) to iOS' CATransform3D . I'd like them to be as close as possible in terms of accurately reproducing the "warp" effect on the Core Graphics side. Example code would really be appreciated! From iOS' CATransform3D.h: /* Homogeneous three-dimensional transforms. */ struct CATransform3D { CGFloat m11, m12, m13, m14; CGFloat m21, m22, m23, m24; CGFloat m31, m32, m33, m34; CGFloat m41, m42, m43, m44; }; Similar questions: Apply homography matrix using Core

How do I use CATransform3D on a UIView to add a specific type of perspective?

走远了吗. 提交于 2019-12-04 12:12:01
问题 I've been creating iPhone apps for a while now, using basic transformations (rotations, scale, etc) but now I'd like to do something a little more complex. Maths really isn't my strongest point... but I was wondering how I might go about adding 'perspective' to a UIView (see the image below). I quickly mocked the screenshot up using skew options in Photoshop. I have had a look around stackoverflow for solutions to this, I found How do I apply a perspective transform to a UIView? which works

How to make a CATransform3dMakeRotation rotate the other way? And chain together

流过昼夜 提交于 2019-12-04 10:43:34
I'm working with some Core Animation for the first time and in the process of implementing a playing card that I can flip around, I've decided to use a CALayer to display the contents (not sure how I'm going to get two sides, but that's another question) and I need to be able to flip it over, move it, etc... I'm using CATransaction with some success - in the snippet below, the card moves from the bottom left to the top left and flips over. The problem is that I wan't it to flip the opposite way, but don't know how to tell it, "hey, you're going the wrong way!" [CATransaction begin];

UIView with CATransform3D inside a UITableViewCell = Choppy Scrolling

半世苍凉 提交于 2019-12-04 09:32:24
I'm using a custom UITableViewCell , into which I am placing a subclassed UIView (within contentView , natch). The UIView in question displays a directional arrow and two lines of supporting text. The arrow is displayed by means of a layer with a background color and an arrow-shaped mask. The background color changes to one of two possibilities depending on the direction the arrow is pointing. The view receives a NSNotification whenever it needs to update the arrow (based on, but not identical to, the current heading - each cell and view is different). When it receives notice, the view calls a