Broncos receiver Demaryius Thomas and 49ers cornerback Perrish Cox will oppose each other Sunday night when the 49ers and Broncos meet in Denver. It won’t be the first time.

Thomas testified against Cox in a 2012 sexual assault trial that could have potentially put Cox in prison for life. Cox, a one-time teammate of Thomas’ in Denver, took a year off to fight the accusation and was eventually found not guilty.

During the trial, Thomas testified that Cox said, “she’s ready” before allegedly having sex with the alleged victim who maintained that she was drugged. She later became pregnant, and before the fetus was aborted, DNA tests determined Cox was the father. Cox and his lawyer disputed those results.

Testifying against Cox was fraught for Thomas. His maternal grandmother and mother are in a federal penitentiary on drug charges. Thomas’ mother, Katina Smith, remains in prison partially because she refuses to testify against her mother, Minnie Thomas, who is Demaryius’ grandmother.

Both watched Demaryius play in Denver’s Super Bowl loss in February from prison. In an ESPN E:60 presentation, Demaryius revealed that he urged his mother and grandmother to quit selling cocaine just before they were arrested. Demaryius was 11 at the time.

While Cox was preparing for his trial, the Broncos released him, who they had chosen in the fifth round of the 2010 draft. Denver insisted then and now that it was purely a football decision.

When former Broncos assistant Ed Donatell was hired by the 49ers as the defensive backs coach, he suggested they sign Cox. Cox spent all of 2012 with the 49ers and was then released by the 49ers last season. He was later picked up in Seattle, released again, and eventually signed back with San Francisco.

This summer, he won a roster spot, and then he replaced starter Tramaine Brock who went down with a toe injury in the opener. So far, he has been a revelation, leading the team in fumble recoveries (2), passes defensed (12, no one else has more than 3) and interceptions (3, no one else has more than 1).

Meanwhile, Thomas, a second-team All-Pro, has overcome an early season slump to combine for 350 yards receiving and three touchdowns in the last two games.

The physical matchup is one thing. But what about the psychological one? Does Cox hold a resentment against Thomas for his testimony? And who could blame Thomas for his testimony, particularly in light of his own family history? Will these two, who are likely to be inches away from each other across the line of scrimmage, even talk to each other?

They have already encountered each other twice in preseason games, including one in August at Levi’s Stadium. Cox said he did not shy away from Thomas either time.

“I don’t hold nothing against nobody,” Cox said a few weeks ago. “I have family, I have my teammates. I don’t have anything against that man. I wished him the best. That’s what I told him before the (preseason) game.”

Cox attempts to treat Thomas like any other NFL player.

“I had mixed thoughts about everything when (the trial) was going on, but when everything was over, it was over,” Cox said. “I moved on with my life.”

No one knows what occurred during the night in question. But Cox is surprisingly open about the experience, about his year away from football, and his re-emergence this season. He has repeatedly said the experience changed him and that 2012 was year to work on himself.

It seems all anyone can do is judge Cox on how he is now, and if that’s the case, he is rarely without a smile and he seems to love the game more than most. Even if that means facing a player and a situation that could have dramatically changed his life.

“That situation made me grow as a human being, as a person,” Cox said. “(Facing Thomas), that’s a small thing. I have bigger things in my life.”