• 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: CATransform3D perspective question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CATransform3D perspective question


  • Subject: Re: CATransform3D perspective question
  • From: Nicko van Someren <email@hidden>
  • Date: Sat, 1 Dec 2007 22:43:55 +0000

On 1 Dec 2007, at 17:10, John Harper wrote:

Presumably you did what the samples do and set the perspective matrix as the sublayerTransform property of the superlayer of the layer you're rotating?

Yes, that's right.

Both sublayerTransform and transform properties are applied relative to the anchor point (typically center, though appkit sets the anchor of layers it creates to the bottom left corner iirc) of the layer the property is set on. So if you have two layers, one with a perspective matrix, and its child rotated around the Y axis by 90°, you will only see the child layer exactly edge on when its center is aligned with the center of its superlayer. Does that explain what you're seeing?

Aha. Thank you. That explains what I'm seeing exactly. The image that was being rotated was off-centre in the layer that contained the perspective transformation and turning it though 90 degrees left it "pointing towards the origin" in the parent layer. Adding an intermediate (empty) layer, moving the perspective transform up to the intermediate layer and then centring the later containing the image to be rotated in that layer now allows the image to rotate as I would expect.


I've filled a bug report on the documentation for this, since there is currently no description of the nature of the transformations that take place.

Thanks again for the help,

	Nicko

_______________________________________________

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


References: 
 >Re: CATransform3D perspective question (From: John Harper <email@hidden>)

  • Prev by Date: Re: NSError and proper cleanup
  • Next by Date: NSViewController and other view issues
  • Previous by thread: Re: CATransform3D perspective question
  • Next by thread: ImageKit + GC = nogo? (or better... how :D)
  • Index(es):
    • Date
    • Thread