Graphics Reference
In-Depth Information
CHAPTER 5
IN THIS CHAPTER
Layer Transforms
. Scale Transform
. Using -rotateTransform:
. Using -rotate3DTransform:
. Anchor Points
. Combining Transforms
U p to this point, we have discussed how to move
elements around the screen, change their color, and various
other interesting effects. In this chapter, we take that quite
a bit further. Transforms is a catchall to describe applying a
matrix transform to a layer for some startling results.
. Scale Versus Bounds
What is a transform? A transform is a term used to include
any function that alters the size, position, or rotation of an
object, in our case a layer. Transforms scale a layer up or
down and rotate a layer along one or more planes.
Transforms are applied using a matrix function that fortu-
nately we do not need to interact with directly. Whenever
we want to rotate or scale a layer, we must use a transform
to accomplish the desired effect.
The topic of matrix transforms can quickly turn into a
deeply mathematical conversation that is beyond the scope
of this chapter. Instead, this chapter touches on a few of
the more common and interesting transforms, such as
rotating a layer in 3D space or creating interesting zoom
effects, and how to bring them about.
NOTE
Layer Transforms in
Cocoa Touch
Unless otherwise specified, all the transforms discussed in
this chapter can be performed both on the desktop and on
any device that uses Cocoa Touch. However, it should be
noted that transforms can be computationally-intensive, and
on a device running Cocoa Touch, it is wise to test the
performance of the animation to confirm that it is within
acceptable boundaries.
 
Search WWH ::




Custom Search