Three.js Tournament Bracket (Radial, Elo Simulation)
A 16-team single-elimination bracket in Three.js, laid out radially or classically, with matches simulated round by round from Elo win probabilities, the champion's path highlighted and title odds from 2,000 Monte-Carlo tournaments.
Key topics: tournament bracket, elo rating, monte carlo simulation, three.js bracket, sports visualization, radial tree
Game Over
What this code does
- Seeding: the standard 1v16, 8v9, … order keeps top seeds apart until late rounds.
- Elo Win Probability: P(A beats B) = 1 / (1 + 10^((R_B − R_A)/400)); the upset factor flattens it toward a coin flip.
- Radial Layout: each round sits on a smaller ring, with slot i at angle (i + ½)/2^k·2π, so the champion lands at the centre.
- Monte Carlo: 2,000 full simulations estimate each team's title odds, which favourites rarely exceed 40%.
- Highlighting: after the final the champion's route is drawn in gold, and losers grey out.
- Controls: layout, upset factor, autoplay, next round and new tournament; teams are fictional.
Related Demos
Continue Learning
JavaScript Implementation
// Single-elimination bracket simulated with Elo win probabilities
const winProb = (ra, rb) => 1 / (1 + 10 ** ((rb - ra) / 400))
let round = seeds.slice() // [1, 16, 8, 9, 5, 12, …]
const rounds = [round]
while (round.length > 1) {
round = round.flatMap((t, i) => (i % 2 ? [] : [Math.random() < winProb(elo[t], elo[round[i + 1]]) ? t : round[i + 1]]))
rounds.push(round)
}
// Radial layout: round r on ring radius R[r], slot i at angle (i + 0.5) / 2^(4−r) · 2π