For rotating 3D shapes rotateX( ) , rotateY( ) and rotateZ( ) functions are used.
rotateX ( ) - x-axis
rotateY ( ) - y-axis
rotateZ ( ) - z-axis
For rotating in all directions use all the three functions together.