• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to make a CALayer dont get blur when rotating.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to make a CALayer dont get blur when rotating.


  • Subject: Re: How to make a CALayer dont get blur when rotating.
  • From: Gustavo Pizano <email@hidden>
  • Date: Tue, 16 Dec 2008 14:59:33 +0100

I was thinking about that, I put a 90.0f but that didn't help let me see the M_PI_2 works..... nop once it gets to vertical position the image its not focused.

:S


Gus.


On 16.12.2008, at 14:48, Dimitri Bouniol wrote:

It's because you are multiplying/dividing a double (M_PI) by and int, so you get an int. A 90° angle in radians is defined as π/2, so try the constant M_PI_2. Hope that works :3

PS. You can also make an int into a float by appending a "." to the number, as such: 90. * M_PI / 180. ; but using M_PI_2 should give much more accurate results, and may be slightly faster (pre- calculated constant).

On Dec 16, 2008, at 3:31 AM, Gustavo Pizano wrote:

mm no. let me try it.m... nop it didn't work. still the image after the transition its blurred.

Gus


On 16.12.2008, at 12:22, Martin Carlberg wrote:

Have you tried to add the following line?

[nLayer setValue:[NSNumber numberWithFloat:.9999] forKeyPath:@"transform.scale"];

- Martin Carlberg


13 dec 2008 kl. 19.49 skrev Gustavo Pizano:

Hello well finally I manage to rotate the CALayer each time I click on it. what I did was the following:

-(void)mouseDown:(NSEvent *)event
{
	[event retain];
	[mouseDownEvent  release];
	mouseDownEvent = event;
	NSPoint p2 = [event locationInWindow];
	NSPoint p3 = [self convertPoint:p2 fromView:nil];
	CGPoint p = NSPointToCGPoint(p3);
	CALayer * nLayer = [_gameboardLayer hitTest:p];

if (nLayer.name != nil) {

NSNumber* value = [NSNumber numberWithFloat:PERP()];
value = [NSNumber numberWithFloat:[value floatValue] + [[nLayer valueForKeyPath:@"transform.rotation.z"] floatValue]];
[nLayer setValue:value forKeyPath:@"transform.rotation.z"];

}

}


#define PERP () (90 * M_PI / 180)

but I realize that each time the images its perpendicular its kinda blurry I dunno how to rotate the layer without loosing quality.

the contents of the layer its .png


Thanks


Gus _______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com


Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

-- 定魅刀利 Dimitri Bouniol email@hidden http://www.appkainime.com/


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: How to make a CALayer dont get blur when rotating.
      • From: Dimitri Bouniol <email@hidden>
References: 
 >How to make a CALayer dont get blur when rotating. (From: Gustavo Pizano <email@hidden>)
 >Re: How to make a CALayer dont get blur when rotating. (From: Martin Carlberg <email@hidden>)
 >Re: How to make a CALayer dont get blur when rotating. (From: Gustavo Pizano <email@hidden>)
 >Re: How to make a CALayer dont get blur when rotating. (From: Dimitri Bouniol <email@hidden>)

  • Prev by Date: Re: What is the default time for a CALayer transform?
  • Next by Date: Re: What is the default time for a CALayer transform?
  • Previous by thread: Re: How to make a CALayer dont get blur when rotating.
  • Next by thread: Re: How to make a CALayer dont get blur when rotating.
  • Index(es):
    • Date
    • Thread