core-animation

SceneKit Rigged Character Animation increase performance

大城市里の小女人 提交于 2019-12-07 15:58:49
问题 I have *.DAE files for characters each has 45-70 bones, I want to have about 100 animated characters on the screen. However when I have ~60 Characters the animations takes ~13ms of my update loop which is very costly, and leaves me almost no room for other tasks. I am setting the animations "CAAnimationGroup" to the Mesh SCNNode when I want to swap animations I am removing the previous animations with fadeOut set to 0.2 and adding the new Animation with FadeIn set to 0.2 as well. -> Is it bad

Why should I use the block-based animation rather than begin/end animation?

只谈情不闲聊 提交于 2019-12-07 14:39:33
问题 As you know, Apple encourages us to use a new method called block-based animation about animation over iOS 4.0. I really wonder what block-based animation is better than begin/end style animation. performance? concurrency? coding efficiency and convenience? 回答1: I wondered about this too back then. But after using block based animations like this: [UIView animateWithDuration:0.5 ... ^{ // animated custom view vertically } completion:^{ [UIView animateWithDuration:0.5 ... ^{ // animate the

Static background for CGContext

梦想与她 提交于 2019-12-07 11:28:35
问题 this is my first question here, so hello everyone. I have spent some time now wrapping my mind around the following problem and could not come up with a solution. I'd be happy if someone could point me in the right direction. I'm using CGContext to draw various layers of graphical representations of live data which should be refreshed at a reasonable framerate of at least 50fps. I want to use a static image as a background. Re-drawing this image using the context for every cycle significantly

Get a reference of an animation created by UIView's animateWithDuration or identify it by any other means

霸气de小男生 提交于 2019-12-07 10:29:58
问题 Let's say that I make an animation like so: [UIView animateWithDuration:0.5 delay:0.0 options:UIViewAnimationOptionCurveEaseInOut animations:^{ someView.frame = CGRect(0, 100, 200, 200); } completion:nil]; And Let's say that I have subviews inside someView that have their layoutSubviews method overridden. I would like to identify an ongoing animation inside that layoutSubviews and make corresponding actions depending if the animation I detected was created by me, or if it is for example an

CAShapeLayer path spring animation not 'overshooting'

白昼怎懂夜的黑 提交于 2019-12-07 09:19:54
问题 I'm experimenting with animating CAShapeLayer paths with CASpringAnimation. The expected result is a 'morphing' between shapes that acts 'springy'. I have a basic code example between a circle and square path as below, however the end result is a spring animation that does not 'overshoot' past the final, larger square path, which is the expected behaviour. My code is: let springAnimation = CASpringAnimation(keyPath: "path") springAnimation.damping = 1 springAnimation.duration =

How to change a UIView zPosition?

∥☆過路亽.° 提交于 2019-12-07 09:03:08
问题 I dont understand how to change the zPosition of a view, i try this but nothing happens : - (void)viewDidLoad { [super viewDidLoad]; UIView *view = [[[UIView alloc] initWithFrame:CGRectMake(100, 100, 100, 100)] autorelease]; view.backgroundColor = [UIColor blackColor]; view.layer.zPosition = -400; [self.view addSubview:view]; } In the CALayer doc it doesn't say anything should be done before using this property. Does anyone knows what i'm missing ? Thanks, Vincent. 回答1: For the zPosition of a

Layer-backed NSView animation

做~自己de王妃 提交于 2019-12-07 08:57:04
问题 I have a certain NSView that I want to animate, but that NSView has a NSTableView inside which does not display correclty when the view is layer-backed (which in turn is nececessary to animate a view). So my answer was to make the view layer-backed right before animating, and then when the animation was done remove the layer, like this: [animatingView setWantsLayer: YES]; [NSAnimationContext beginGrouping]; [[animatingView animator] animateSomething]; [[NSAnimationContext currentContext]

Could you recreate the 3D page turning effect seen in the iBooks app using only Core Animation or would you need to use OpenGL ES?

柔情痞子 提交于 2019-12-07 08:55:26
问题 I read an article somewhere explaining that apple uses OpenGL ES to implement the page turning effect in the iBooks app. Since you can perform 3D animations on 2D Layers using only Core Animation, what might be some reasons you'd have to use OpenGL ES to create that page transition animation? Thanks in advance for your thoughts! 回答1: Steven Troughton-Smith has accomplished this here without OpenGL. http://blog.steventroughtonsmith.com/2010/02/apples-ibooks-dynamic-page-curl.html However, he

Scaled image in NSImageView looks bad with layer-backing on

一曲冷凌霜 提交于 2019-12-07 08:27:27
I'd like to have a view with a gradient background and a image. So I turned on layer backing for the layer, added NSImageView and set the layer to CAGradientLayer . However, this makes the scaled-down image very ugly. See the comparison: Layer ON: , layer OFF: Has anyone observed this too? Is there any way to resolve this problem without turning off layer backing? I stumbled across this question after running into exactly the same problem. The rendering for a layer-backed NSImageView looked horribly scaled, but non-layer-backed one looked great. I tried a number of different things, but in the

Add a shadow to CAShapeLayer, so that the inside remains transparent

Deadly 提交于 2019-12-07 08:23:54
问题 I want to add a glow effect to a path, like the blue glow around (OS X) interface elements when they have focus. I used a CAShapeLayer with a (rectangular) path: self.borderLayer = [CAShapeLayer layer]; CGPathRef path = CGPathCreateWithRect(self.bounds, NULL); [self.borderLayer setPath:path]; CGPathRelease(path); In the end this gives me a transparent UIView with a border around it. (In my concrete case it's a dashed line with an additional animation, but that doesn't matter for this