@@ -499,54 +499,54 @@ import { AthleteRenderer } from "./AthleteRenderer.js";
499499
500500 function addConnectedPodium ( scene , pos ) {
501501 const depth = pos . Gold . podiumDepth ;
502+ const capH = 0.18 ; // thickness of the grey standing cap
503+ const overlap = 0.02 ;
502504
503- const sideMat = new THREE . MeshStandardMaterial ( {
504- color : 0xf5f5f5 ,
505- roughness : 0.8
506- } ) ;
507-
508- const topMat = new THREE . MeshStandardMaterial ( {
509- color : 0xaaaaaa ,
510- roughness : 0.7
511- } ) ;
505+ const whiteMat = new THREE . MeshStandardMaterial ( { color : 0xf5f5f5 , roughness : 0.8 } ) ;
506+ const greyMat = new THREE . MeshStandardMaterial ( { color : 0xaaaaaa , roughness : 0.7 } ) ;
512507
513- const mat = [ sideMat , sideMat , topMat , sideMat , sideMat , sideMat ] ;
508+ // Cap material: grey ONLY on the top face (+Y = index 2), white everywhere else
509+ const capMat = [ whiteMat , whiteMat , greyMat , whiteMat , whiteMat , whiteMat ] ;
514510
515- const silverLeft = pos . Silver . x - pos . Silver . podiumWidth / 2 ;
516- const goldRight = pos . Gold . x + pos . Gold . podiumWidth / 2 ;
511+ const silverLeft = pos . Silver . x - pos . Silver . podiumWidth / 2 ;
512+ const goldRight = pos . Gold . x + pos . Gold . podiumWidth / 2 ;
517513 const bronzeRight = pos . Bronze . x + pos . Bronze . podiumWidth / 2 ;
518514
519515 const bronzeH = pos . Bronze . podiumHeight ;
520516 const silverH = pos . Silver . podiumHeight ;
521- const goldH = pos . Gold . podiumHeight ;
517+ const goldH = pos . Gold . podiumHeight ;
522518
523- const overlap = 0.02 ;
524- const layers = [
525- {
526- w : bronzeRight - silverLeft ,
527- h : bronzeH ,
528- cx : ( silverLeft + bronzeRight ) / 2 ,
529- cy : bronzeH / 2
530- } ,
531- {
532- w : goldRight - silverLeft ,
533- h : silverH - bronzeH + overlap ,
534- cx : ( silverLeft + goldRight ) / 2 ,
535- cy : bronzeH + ( silverH - bronzeH + overlap ) / 2 - overlap / 2
536- } ,
537- {
538- w : pos . Gold . podiumWidth ,
539- h : goldH - silverH + overlap ,
540- cx : pos . Gold . x ,
541- cy : silverH + ( goldH - silverH + overlap ) / 2 - overlap / 2
542- }
543- ] ;
544-
545- layers . forEach ( ( { w, h, cx, cy } ) => {
519+ // Helper to add a box
520+ const addBox = ( w , h , cx , cy , mat ) => {
546521 const mesh = new THREE . Mesh ( new THREE . BoxGeometry ( w , h , depth ) , mat ) ;
547522 mesh . position . set ( cx , cy , 0 ) ;
548523 scene . add ( mesh ) ;
549- } ) ;
524+ } ;
525+
526+ // ── Structural boxes (all white) ──────────────────────────────────
527+ // Heights are shortened by capH so the grey cap sits flush on top.
528+ // A small overlap prevents z-fighting at the seam between layers.
529+
530+ // Layer 1 — full-width base, y: 0 → bronzeH-capH
531+ const h1 = bronzeH - capH ;
532+ addBox ( bronzeRight - silverLeft , h1 ,
533+ ( silverLeft + bronzeRight ) / 2 , h1 / 2 , whiteMat ) ;
534+
535+ // Layer 2 — silver+gold section, y: bronzeH-capH → silverH-capH
536+ const h2 = silverH - bronzeH + overlap ;
537+ addBox ( goldRight - silverLeft , h2 ,
538+ ( silverLeft + goldRight ) / 2 , ( bronzeH - capH ) - overlap / 2 + h2 / 2 , whiteMat ) ;
539+
540+ // Layer 3 — gold-only section, y: silverH-capH → goldH-capH
541+ const h3 = goldH - silverH + overlap ;
542+ addBox ( pos . Gold . podiumWidth , h3 ,
543+ pos . Gold . x , ( silverH - capH ) - overlap / 2 + h3 / 2 , whiteMat ) ;
544+
545+ // ── Grey caps (grey top, white sides) ────────────────────────────
546+ // Each cap sits exactly in the athlete's standing area.
547+ addBox ( pos . Bronze . podiumWidth , capH , pos . Bronze . x , bronzeH - capH / 2 , capMat ) ;
548+ addBox ( pos . Silver . podiumWidth , capH , pos . Silver . x , silverH - capH / 2 , capMat ) ;
549+ addBox ( pos . Gold . podiumWidth , capH , pos . Gold . x , goldH - capH / 2 , capMat ) ;
550550
551551 const ringsW = 6.0 ;
552552 const ringsH = ringsW * ( 175 / 420 ) ;
0 commit comments