DALLAS (Reuters) - Facebook Inc FB.O chief executive Mark Zuckerberg took the witness stand in Dallas federal court on Tuesday and denied an allegation by a rival company that the virtual-reality technology of Facebook's Oculus unit was stolen.

Facebook CEO Mark Zuckerberg is seen on stage during a town hall at Facebook's headquarters in Menlo Park, California September 27, 2015. REUTERS/Stephen Lam/File Photo

Zuckerberg, the founder of one of the world’s largest companies, faced hours of tough, public questioning about where Oculus obtained its ideas and how much he knew about the startup when Facebook bought it for $2 billion.

A jury is hearing evidence in a civil lawsuit brought by videogame publisher ZeniMax Media Inc against Oculus in 2014, in the middle of the Facebook-Oculus deal. ZeniMax said that Oculus unlawfully used its intellectual property to develop the virtual-reality system that includes the Rift headset.

During one heated exchange with ZeniMax lawyer Tony Sammi, Zuckerberg told a jury in the crowded courtroom that the technology was not even fully formed when Facebook bought it.

“Improving on that technology doesn’t make it yours,” Sammi countered. “If you steal my bike, paint it and put a bell on it, does that make it your bike?”

Zuckerberg, wearing a dark suit and striped tie rather than his typical T-shirt and jeans, answered, “no,” but then added: “The idea that Oculus technology is based on someone else’s is just wrong.”

The 32-year-old Facebook founder has spoken about virtual reality as an important part of the company’s future business, especially as the technology becomes less expensive and its uses clearer.

The Oculus acquisition was more expensive than the $2 billion price tag indicated, Zuckerberg said in court, describing $700 million spent to retain employees and $300 million in payouts for reaching milestones. Oculus originally wanted $4 billion, he said.

Sammi questioned whether Facebook knew what it was doing when it made the acquisition. Zuckerberg said the Oculus deal was done over a weekend in 2014, which Sammi said did not show sufficient due diligence. Zuckerberg said, though, in later testimony that Facebook researched Oculus for months.

At the time, Zuckerberg testified, he was not aware of any theft claims against Oculus.

“It’s pretty common when you announce a big deal that people just come out of the woodwork and claim they own some part of the deal,” Zuckerberg said.

On the stand, he also gave details about Facebook’s $22 billion purchase of messaging service WhatsApp in 2014. While the deal was in progress, another company he did not identify made a last-minute bid that was higher, Zuckerberg said, but WhatsApp declined because of its good relationship with Facebook.

The Oculus lawsuit, in the sixth day of a jury trial, relates in part to programmer John Carmack.

Well-known for helping to conceive games such as “Quake” and “Doom,” Carmack worked for id Software LLC before that company was acquired by ZeniMax. He is now the chief technology officer at Oculus.

Zuckerberg denied that Carmack has unfairly used computer code from his previous position. “There is no shared code in what we do,” he said.

Zuckerberg said he has been interested in virtual reality since he was a student, but thought it was decades away from happening before he encountered Oculus. He told jurors how he used virtual reality to capture his daughter’s first steps, so her grandparents could experience it later.

“We want to get closer to this kind of perfect representation, so you can capture a moment you had,” he said.

The case is ZeniMax Media Inc et al v. Oculus VR Inc et al, U.S. District Court for the Northern District of Texas, No. 3:14-cv-1849.