Film-maker Roman Polanski told jurors he was in a "state of shock" when he read the magazine article that now lies at the centre of a London libel case.
Polanski is testifying from Paris to avoid possible extradition to the US
He is suing over a claim he made sexual advances to a woman in a restaurant on the way to his wife's funeral.
The Oscar-winning director spoke to the London High Court via video link from Paris, where he lives, as if he enters the UK he faces extradition to the US.
Publisher Conde Nast denies libel over an article published in July 2002.
Mr Polanski won the right to testify by video amid fears that if he entered the UK he would have to face child sex charges in the US.
He told the jury of nine men and three women: "This was the worst thing ever written about me. It's absolutely not true.
"But I think it was particularly hurtful, because it dishonours my memory of Sharon," he added.
The article referred to events following the death of Mr Polanski's wife, actress Sharon Tate, who was murdered by followers of US serial killer Charles Manson in Los Angeles in 1969.
"It's all lies," said Mr Polanski, wearing a black suit and standing during his testimony. "That's not the way I behave. Still I had some honour. Still I have it now."
Mr Polanski struggled to maintain his composure as he spoke of his late wife.
"Sharon was sweet, bright, brilliant. She had a great sense of humour. She was in my eyes the perfect woman."
However, Tom Shields, lawyer for Vanity Fair, which published the article, suggested that Mr Polanski was not just a fugitive from justice, but something "grotesque" - a "fugitive from morality, from moral standards".
"Well, you are putting it in a grotesque way," replied Mr Polanski.
Questioned about his sexual promiscuity, Mr Polanski admitted he had been unfaithful to Ms Tate before and during their marriage.
He spoke of how he sought solace in the opposite sex after the death of his wife, but was "unable to develop any lasting relationship".
"The death of Sharon and the whole tragedy and of my friends was immeasurably sad to me," said Mr Polanski. "In such moments some people turn to drugs, others to alcohol, some go to a monastery - to me it was sex."
Mr Polanski's lawyer, John Kelsey-Fry, said action was not about the director's "somewhat laissez-faire attitude to casual sex" earlier in his life.
The director was convicted of having unlawful sex with a 13-year-old girl in Hollywood in 1977. He fled the US and faces immediate arrest should he return.
Actress Mia Farrow is expected to testify at the trial
Mr Kelsey-Fry said the incident was a "most unsightly blot" on Mr Polanski's reputation, but that it had nothing to do with the current libel case.
He said the accusations levelled at the director in the Vanity Fair article suggested "a callous indifference to what had happened and to his wife's memory of breathtaking proportions".
Publisher Conde Nast is based in the United States, but the claim is being pursued in the English courts, which are perceived as being more generous toward libel claimants.
Actress Mia Farrow is also expected to testify, in person, on behalf of the director with whom she made Rosemary's Baby in 1968.
The case continues.