A geometric construction of generalized quadrangles from polar spaces of rank three