... 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<chunk1...@gmail.com> 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<kyle.slu...@gmail.com> wrote:
>> On Wed, Jun 17, 2009 at 9:14 AM, Gordon Apple<g...@ed4u.com> 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 (Cocoa-dev@lists.apple.com)
>>
>> 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:
>> http://lists.apple.com/mailman/options/cocoa-dev/chunk1978%40gmail.com
>>
>> This email sent to chunk1...@gmail.com
>>
>
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to