"I had just glanced over my shoulder and I noticed there was a webcam that was faced toward the direction of the bed," said the man, identified only by the initials M.B. "Just being in a compromising position and seeing a camera lens - it just stuck out to me."
The man testified that he had met Tyler Clementi in August 2010 through a social networking site for gay men.
They chatted online initially, he said, and their first in-person meeting was in Clementi's dorm room on September 16 - three days before the alleged spying. Mr Clementi killed himself days later.
The man's testimony came in the trial of Mr Clementi's roommate, Dharun Ravi, who is charged with bias intimidation, invasion of privacy and other crimes.
The judge did not allow photographs of M.B. to be taken in the courthouse, barred any audio or video of him to be taken and said that he would be identified in court only by his initials. The man's lawyer had successfully fought to conceal his identity because he's considered a victim of an alleged sex crime.
Jurors were given his whole name to make sure none knew him.
On Friday, the trim young man appeared in court in a button-down shirt, and did not match the description of the overweight "sketchy" or "homeless"-looking man that students had reported seeing visit Mr Clementi. His hair was closely cropped and he didn't have the goatee that some described seeing him have.
Because of the secrecy surrounding the man's identity, there was an unusually large media contingent packed into the Middlesex County Courthouse for what was already a high-profile trial.
But in a little more than 30 minutes of direct-examination, not much light was shed on who he is.
He said he lived about a 20-minute drive from Mr Clementi's dorm and was starting a new job on September 20, 2010.
He testified that he met Mr Clementi in his dorm room three times. The first was on September 16, when he said Ravi was not expected home until the middle of the night.
The second was on September 19, the date of the alleged spying - and the time he said he noticed the webcam.
He said he and Clementi were naked and had sex that night. People who saw webcam images of his encounter with Mr Clementi have testified that they saw no more than a few seconds of video and that the men were not seen doing anything more graphic than kissing. At one point, some said, their shirts were off, but their pants were on.
The man told jurors there were about five students looking at him as he left the building on September 19.
"Had they been in the street or somewhere other than this building I would have asked them why they were looking at me," he said. He called their actions "unsettling."
The third time he met Mr Clementi was two days later, when Ravi is charged with attempted invasion of privacy.
There's been testimony that the webcam feed did not work that night. According to court papers filed previously, it was unplugged.
M.B. testified that he heard comments from the courtyard outside the dorm that night that bothered him. But he was not allowed to say what it was.
He testified that he wanted to see Clementi again. "As far as whether I was going to return to that building to see him, I felt a little uneasy about it," he said.
Mr Ravi faces 15 criminal counts. The most serious is bias intimidation, a hate crime punishable by up to 10 years in prison.
Much of the testimony so far has come from college students. Several said Ravi told them that he'd used a webcam to see what was happening in the room he shared with Mr Clementi on September 19 and that he set up the camera again September 21.
But none said that he had general malice toward gays.