Shock formation for 3-dimensional wave equations