2008 05 01Core Animation is right handed
For some reason I thought CA was left handed — I had my layers set with a positive Z value. The layers showed up where I was expecting them, but visually it was a mess : the far layers were drawn on top of the near layers ! Using a negative Z value fixed the glitch.
Perspective in CA, using 3D CALayer
s and a perspective transform :
your eye layers are closer (bigger) here layers have same size as in 2D layers are farther (smaller) here ------------------ positive Z value ------------------------- zero Z value ----------------------- negative Z value---------
Ah thanks, I didn't know the official name, just "* handed".
Anyway if you come from DirectX and code in Core Animation, hands are reversed. In a 3D engine, setting a badly signed Z value on layers would make them invisible. CA did draw them, inversely sorted.
Pour être précis, cette "règle de la main droite" signifie géométriquement qu'on choisit une base orthonormée directe de l'espace de dimension 3, alors qu'utiliser la main gauche conduirait au choix d'une base indirecte de l'espace ... ce qu'on fait moins souvent dans la pratique, pour des raisons de convention: sinon, il faudrait par exemple changer l'expression matricielle des rotations en dimension 3, etc. etc. Enfin, tant que c'est de la 2d augmentée, il faut juste savoir que l'axe des Z pointe vers le codeur et non pas l'écran !
I don't think this is correct. X right, Y up and Z out of screen is right-handed. But CoreAnimation is not Y up, it is Y down. So it is actually left-handed, but with Z out of screen.
Not to be a dick, but there is this thing called the "right hand rule" for 3-spaces.