SANTA BARBARA, Calif.—Marcus Elliott is an unlikely source of wisdom for an industry that pours millions of dollars into scouting talent. A physician who founded a sports-science company here, Elliott freely admits to not watching much sports. But in the weeks before last year’s NBA draft, Elliott knew something the league’s 30 teams didn’t.

He was sitting on a trove of secret information about the best young basketball player in the world.

Luka Doncic was a mostly unknown Slovenian teenager barely playing for his Spanish team in 2015, when he began flying halfway across the world to spend his summers at Peak Performance Project, which is better known as P3. He came here because Elliott’s gym is at the vanguard of collecting biomechanical measurements that detail in precise terms the way that professional athletes do their jobs. And his time at P3 produced so much useful information that one team with a lottery pick in last year’s draft suggested it would pay for Elliott’s highly valuable intelligence.

“That was the first time that a team offered cold, hard cash for data,” Elliott said.

He declined the offer, but it probably won’t be the last one. Doncic is now the face of basketball’s next generation in part because of what happened long before his dazzling rookie season with the Dallas Mavericks. He’s part of a wave of precocious talents flooding the league with a deeper understanding of the economic assets that make them valuable: their own bodies.

P3 operates from an unremarkable building tucked away at the end of a quiet street with a surf shop, art gallery and brewery. Doncic, who turned 20 last month, made the long journey here in 2015, 2016 and 2018. He began every trip with a series of tests that provided him with a breakdown of his physical attributes, injury risks and biomechanical habits, and he left knowing more about himself than most NBA veterans.

Doncic wasn’t like the seasoned basketball players around him. With his baby face and sandy hair, he looked more like a surfer who got lost on his way to the beach. But the bigger difference between Doncic and the older players was that they discovered P3 when they were already in the NBA—not when they were 16 and needed to be accompanied by their mothers.

The star rookie learned in his trips here that he didn’t jump very high or move very quickly from side to side. But he did have one hidden athletic talent that explained his unstoppable moves. It turned out Doncic was a young James Harden.

Harden ranks in the 99th percentile of NBA players in a metric called “eccentric force,” which is a fancy way of describing his brakes. He’s the fastest at slowing down. Doncic isn’t far behind him in the 92nd percentile. And their games have evolved around their natural advantage. The one shot that rewards their lower-body strength is the stepback three, and Harden and Doncic are No. 1 and No. 2 in stepback threes this season.

How they launch so many of the game’s trickiest shots would’ve been a mystery not too long ago. But that’s why they visit P3: to make the intangibles more tangible.

NBA rookie Luka Doncic specializes in stepback jumpers. Photo: Gerald Herbert/Associated Press

Fast Brakes Deceleration time Rate of deceleration How the biomechanics of NBA MVP James Harden and star rookie Luka Doncic compare with other wing players in their draft classes James Harden Peak braking force Raw braking force Luka Doncic 2009 NBA draft wing average 2018 lottery wing average Braking force per body weight Source: Peak Performance Project Fast Brakes How the biomechanics of NBA MVP James Harden and star rookie Luka Doncic compare with other wing players in their draft classes James Harden Deceleration time Rate of deceleration Luka Doncic 2009 NBA draft wing average 2018 lottery wing average Peak braking force Raw braking force Braking force per body weight Source: Peak Performance Project Fast Brakes Deceleration time Rate of deceleration How the biomechanics of NBA MVP James Harden and star rookie Luka Doncic compare with other wing players in their draft classes James Harden Raw braking force Peak braking force Luka Doncic 2009 NBA draft wing average 2018 lottery wing average Braking force per body weight Source: Peak Performance Project Fast Brakes How the biomechanics of NBA MVP James Harden and star rookie Luka Doncic compare with other wing players in their draft classes James Harden Luka Doncic 2018 lottery wing average 2009 NBA draft wing average Deceleration time Rate of deceleration Raw braking force Peak braking force Braking force per body weight Source: Peak Performance Project

While he threw down breathtaking dunks in his afternoon basketball sessions, the first sign there was something unusual about the only kid in P3 during the summer of 2015 was that he was there to begin with.

Doncic was taking advantage of a peculiar fact: He was an NBA draft prospect who was already a professional basketball player. He didn’t have to bother heeding the rules of amateurism to maintain his college eligibility. Doncic had a job with Real Madrid that paid him real money—P3 charges thousands of dollars for assessments—and his agent helped arrange for him to spend time far, far away from home.

“When you have a prospect that young, the earlier you can expose him to P3, the better,” said Bill Duffy, his agent. “We wanted him to have the information at his disposal.”

It won’t be long before more players barge into the league wielding that much information. P3 has a deal with the NBA to evaluate young players in a pop-up lab at the draft combine, and Elliott’s team started collecting data on college stars like Duke freshmen Zion Williamson and R.J. Barrett several years ago in an effort to chase players at earlier stages of their careers.

That data can be a powerful weapon in the hands of players. Chicago Bulls guard Zach LaVine, for example, suffered the worst possible injury for someone with his explosive athleticism: a torn ACL. The only silver lining was that P3 had baseline data from before his injury. LaVine didn’t have to estimate when he felt like his old self again. All he had to do was look at the data. His agents even cited that data in contract negotiations last summer to earn him an $80 million deal.

The existence of so much personal information about such high-profile athletes is bound to raise privacy concerns, but Elliott is adamant that only players have access to their data and that he understands the importance of protecting it.

“We have to be Switzerland,” he said.

Doncic’s data was a mystery to the Mavericks when they wagered the future of the franchise on him. It’s been a spectacular bet. There have only been three rookies in NBA history to average 20 points, 5.5 rebounds and 5 assists per game: Oscar Robertson, Michael Jordan and LeBron James. The fourth would be Luka Doncic.

Doncic won the European title with Slovenia at 18 and the EuroLeague championship with Real Madrid at 19, and the Mavericks scouted him enough to know that he was close to a sure thing. “But look,” said Dallas general manager Donnie Nelson . “No one, us included, expected him to do what he’s doing out of the gates.”

But the people who knew him from P3 were not surprised. They saw this coming before anyone.

“He’s been on a path for a long time,” said Utah Jazz guard Kyle Korver, who’s trained with Doncic since 2015. “It’s like he was made for this.”

Korver and Doncic bonded despite their generational divide: Korver went to P3 to extend his NBA career, and Doncic went to P3 before he even had an NBA career.

“Man, if I’d known this when I was 16 years old,” said Korver, who turns 38 next week. “I can’t even imagine what my data would look like.”

Doncic doesn’t have to use his imagination. He’ll be able to trace his development through his data. He’s among the first of many players whose lives in basketball will be quantified.

On a recent afternoon, P3 employees in their customary athleisure crowded around the computer screen of Eric Leidersdorf, the lab’s director of biomechanics. He clicked on his Doncic file and opened a video of his standing vertical jump in 2015.

Luka Doncic in 2015 Photo: Courtesy of P3

“This is day one,” Leidersdorf said.

“This is when he’s really skinny,” said director of operations Adam Hewitt.

“He was a kid,” Leidersdorf said.

He pulled up another video. This one was Doncic in 2018.

Luka Doncic in 2018 Photo: Courtesy of P3

By then P3 employees had assessed him, analyzed his data, customized his workouts, tracked his progress and tested him again the next summer. Now they were looking at the results. Everything about the second video was identical except for Doncic.

It’s been only four years since his first pilgrimage here. But his entire life has changed so dramatically that it feels more like forever.

“It was a long time ago,” Doncic said.

Write to Ben Cohen at ben.cohen@wsj.com