CSS3 3D transforms

All of the transform functions we have looked at so far are two-dimensional, operating on just the x and y axes. Transforms that operate in three dimensions, along x, y, and z axes have also been proposed.

3D equivalents of all of the transform functions exist and usually just take an extra parameter which corresponds to the vector of each dimension, and the angle. For example, a 3D rotation could be added using this code:

transform: rotate3d(0, 1, 0, 30deg);

As with 2D transforms, there is an all-encompassing matrix function that allows us to implement any of the other transforms and allows us to combine some of them together on a single element.

If, like me, you thought the 2D transform matrix, with its six parameters, was complex ...

Get jQuery 1.4 Animation Techniques Beginner's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.