Skip navigation.
 
mlRe: How do I rotate an image?
FROM : Ricky Sharp
DATE : Tue Jan 29 23:12:50 2008

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_removed>
Instant Interactive(tm)  http://www.instantinteractive.com

Related mailsAuthorDate
mlHow do I rotate an image? Mac Man Jan 29, 20:10
mlRe: How do I rotate an image? Colin Cornaby Jan 29, 22:44
mlRe: How do I rotate an image? Ricky Sharp Jan 29, 23:12
mlRe: How do I rotate an image? douglas a. welton Jan 30, 02:21