Daniel Dove told the court he complied with the police up until the point he felt he was being humiliated.
"I felt embarrassed, he said. "I flicked my pants at him because I was annoyed at what he had done.
"I didn't know he (PC Birch) had a taser. He pulled it from behind his back and shot me with it. I think it was unrational (sic) to use it."
Under cross-examination Mr Dove denied being abusive and threatening club door staff. He also refuted kneeing a police officer in the groin during his arrest.
A jury has been shown the moment a police officer shot a man with a taser after the victim flicked him in the face with his underpants.
31 year old PC Lee Birch is standing trial at Bristol Crown Court accused of actual bodily harm and misconduct in a public office.
Daniel Dove was taken to Melksham police station after being arrested outside a Trowbridge night club in December 2012. It is alleged he then assaulted PC Birch and his colleague.
During a strip search, CCTV cameras shown to the jury reveal Mr Dove flicking his boxer shorts at PC Birch.
CCTV footage then shows the police officer, having earlier withdrawn the taser, firing it into Mr Dove's chest.
The victim is then seen to fall to the ground and PC Birch is heard shouting "that's the second time you have assaulted me."