Re: How do I rotate an image?
Re: How do I rotate an image?
- Subject: Re: How do I rotate an image?
- From: Ricky Sharp <email@hidden>
- Date: Tue, 29 Jan 2008 16:12:50 -0600
On Jan 29, 2008, at 1:10 PM, Mac Man wrote:
I am trying to rotate an image along the z-axis, to get a
perspective change
like the Dock appears in Leopard. If I have a rectangular image, is
there
an easy way to rotate it to achieve this? I thought that I might
find some
luck with CATransform3D, but the documentation I've encountered
didn't do
much to help, and I couldn't find any clear examples of how to do
this. If
it can be done without Core Animation, that would work as well. Any
insight
and help would be greatly appreciated!
Do a search on "perspective transformation matrix". That will give
you the mathematics behind what to put in the 4x4 matrix
(CATransform3D struct).
It's been years since I've worked in Linear Algebra, but it may be
possible to split that 4x4 as a product of 3x3 matricies??? If that's
even doable, you theoretically could then apply those "2D" transforms
to the current graphics context to achieve the same effect via say
NSAffineTransform, CG APIs, etc.
Note that unless replies will be talking specifically about what Cocoa
APIs to use, they should probably be kept off-list. This reply isn't
meant to start a thread on the mathematics itself behind this type of
transform.
___________________________________________________________
Ricky A. Sharp mailto:email@hidden
Instant Interactive(tm) http://www.instantinteractive.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