A pupil "froze" and felt "really uncomfortable" when a teacher at Eton College sexually touched him, a court heard.
Matthew Mowbray, 49, is accused of entering boys' rooms and touching them for his own "sexual gratification".
The court also heard from a complainant who said the teacher groped his bottom with a "forceful squeeze".
Mowbray denies nine counts of sexual activity with a child against four boys and a girl.
The former geography teacher has pleaded guilty to downloading hundreds of indecent images of children.
Reading Crown Court heard from one pupil who said Mowbray had made physical contact on five to six occasions during late-night visits to his bedroom.
In a witness statement read to jurors the boy said: "He sat and talked about general things.
"He would gently put his hand down on my thigh and knee and rub his hand up and down my thigh over and over.
"I felt really uncomfortable and just froze."
The boy said that on another occasion he "wanted to shout out" to alert other pupils but "felt I couldn't".
Another complainant described in a police interview how he was "shocked and embarrassed" after Mowbray "groped my bum with basically quite a forceful squeeze", before trying to "laugh it off".
A third boy, who alleged Mowbray also touched him in bed, said in a police interview played in court: "He just took photographs all the time. It made me feel uncomfortable."
Mowbray has admitted six counts of making indecent images of children, including creating pseudo-images of pupils by superimposing their faces on to the naked bodies of unknown children.
He has also admitted one count of voyeurism relating to a series of covertly filmed images showing a boy getting dressed.
Mowbray, of Locks Heath, Southampton, was dismissed from his role at the boys' boarding school, near Windsor, Berkshire, following his arrest.
The trial continues.