CA: Are nested 3D transforms supported?
CA: Are nested 3D transforms supported?
- Subject: CA: Are nested 3D transforms supported?
- From: Jens Alfke <email@hidden>
- Date: Tue, 22 Jul 2008 15:07:03 -0700
I'm trying to add a perspective view to GeekGameBoard, my board-game
framework. I apply a rotation about the X axis, concatenated with a
perspective transform, to the NSView's root layer; this tilts the
board "away from" the screen, giving a more normal viewing angle. So
far so good.
The problem I'm running into is that when the board is tilted this
way, it looks more realistic to use pieces whose icons already
incorporate a perspective effect, as a lot of icons do. That hides the
fact that the pieces are flat. But the pieces then need to be drawn
directly face-on to the screen, i.e. not in the same plane as the game
board. I do this by setting each board square's sublayerTransform to a
rotation about the x axis that's the opposite of the board's.
When I implement this, I get the wrong results. It looks like the
pieces do get rotated, but then they're projected flat onto the board
layer, so when the board tilts back it's clear that it's still flat
but with distorted pieces drawn on it.
As far as I can tell I'm doing everything correctly. Now I'm worried
that there's some undocumented limitation in CA itself that prevents a
layer from lying in a different 3D plane than its superlayer. Is that
so? Any way to work around it?
—Jens
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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