• 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: Group CGAffineTransform Animations?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Group CGAffineTransform Animations?


  • Subject: Re: Group CGAffineTransform Animations?
  • From: Chunk 1978 <email@hidden>
  • Date: Wed, 17 Jun 2009 15:10:10 -0400

... perhaps there's a way to set the transforming object's origin to
it's center some how?  i could work with that...

On Wed, Jun 17, 2009 at 2:37 PM, Chunk 1978<email@hidden> wrote:
> still having issues.  i've changed the order of transforms:
>
> -=-=-=-
>                CGAffineTransform transform =
> CGAffineTransformMakeTranslation(centerPoint.x, centerPoint.y);
>                transform = CGAffineTransformScale(transform, 2, 2);
>                transform = CGAffineTransformRotate(transform, kDegreesToRadian(90));
>                square.transform = transform;
> -=-=-=-
>
> although this code supposedly scales the Square before translating it
> to it's new origin, it maintains the Squares original origin based on
> it's original size.  so eventhough the Square is now twice as big, it
> is translated to the center of the screen minus it's new scale.  i can
> remedy it by adding this:
>
> -=-=-=-
>             CGRect squareFrame = [square frame];
>                CGAffineTransform transform =
> CGAffineTransformMakeTranslation(centerPoint.x +
> squareFrame.size.width / 2, centerPoint.y + squareFrame.size.height /
> 2);
> -=-=-=-
>
> but that seems like a hack...
>
> any ideas?
>
>
> On Wed, Jun 17, 2009 at 12:31 PM, Kyle Sluder<email@hidden> wrote:
>> On Wed, Jun 17, 2009 at 9:14 AM, Gordon Apple<email@hidden> wrote:
>>>    IMHO, matrix operations are one of the most confusing and cumbersome
>>> aspects of Cocoa.  Every time I use them, I end up trying most combinations
>>> until I get the desired result.  C++ doesn't have this problem.  You can
>>> simply write the matrix equations and be done with it. I love Objective C,
>>> but operator overloading (and ctors/dtors) are the things I miss most.
>>> Multiple inheritance -- not so much.
>>
>> This isn't a C++/ObjC issue.  Whatever matrix library you were using
>> under C++ happened to define matrix multiplication in such a way that
>> it performed the operations in reverse order.  XNA, on the other hand,
>> follows the same pattern as Cocoa, even though it's written in C# and
>> therefore has operator overloading.
>>
>> The AppKit team could very easily have implemented NSAffineTransform
>> to transparently define a stack.  But they didn't.  Neither did the
>> OpenGL people, or the XNA people.  But it's not a language issue.
>>
>> --Kyle Sluder
>> _______________________________________________
>>
>> 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

  • Follow-Ups:
    • Re: Group CGAffineTransform Animations?
      • From: WT <email@hidden>
References: 
 >Re: Group CGAffineTransform Animations? (From: Gordon Apple <email@hidden>)
 >Re: Group CGAffineTransform Animations? (From: Kyle Sluder <email@hidden>)
 >Re: Group CGAffineTransform Animations? (From: Chunk 1978 <email@hidden>)

  • Prev by Date: Re: Group CGAffineTransform Animations?
  • Next by Date: Re: repeatable random numbers in an object
  • Previous by thread: Re: Group CGAffineTransform Animations?
  • Next by thread: Re: Group CGAffineTransform Animations?
  • Index(es):
    • Date
    • Thread