So far, we have been applying transformations in 2D planes.
However, transform functions can be applied in 3D planes as well.
In order to perceive a 3D effect in transforms, perspective
is required.
The perspective
property is essential in order to bring realism
as it defines how far the viewer is positioned from the transformed element.
Try changing the perspective
value using the slider given.
Notice that increasing its value will make the object go farther
from the screen along Z-axis.
We can also use rotateY
and rotateZ
to rotate the element along
Y and Z axes.
We do not need any perspective for rotateZ
, it is similar to writing
rotate
without specifying any direction for rotation.