@@ -433,14 +433,14 @@ import { AthleteRenderer } from "./AthleteRenderer.js";
433433 wrapper . appendChild ( canvasWrap ) ;
434434
435435 const width = canvasWrap . clientWidth || 1180 ;
436- const height = 670 ;
436+ const height = 720 ;
437437
438438 const scene = new THREE . Scene ( ) ;
439439 scene . background = null ;
440440
441441 const camera = new THREE . PerspectiveCamera ( 42 , width / height , 0.1 , 200 ) ;
442- camera . position . set ( 0 , 10 , 36 ) ;
443- camera . lookAt ( 0 , 6 , 0 ) ;
442+ camera . position . set ( 0 , 12 , 36 ) ;
443+ camera . lookAt ( 0 , 8 , 0 ) ;
444444
445445 const renderer = new THREE . WebGLRenderer ( {
446446 antialias : true ,
@@ -543,16 +543,27 @@ import { AthleteRenderer } from "./AthleteRenderer.js";
543543 <div class="bodytype-athlete-stats">${ heightStr } · ${ weightStr } </div>
544544 ` ;
545545
546- // Project approximate head position to screen coordinates
547- const v = new THREE . Vector3 ( pos . x , pos . podiumHeight + 14 , 0 ) ;
546+ /*
547+ The label used to be fixed at podiumHeight + 14.
548+ That made short athletes have labels too high above them.
549+ Now the label anchor depends on the athlete's real height.
550+ */
551+ const athleteCm = athlete . height || 170 ;
552+ const normalizedHeight = athleteCm / 170 ;
553+
554+ const estimatedBodyHeight = 11.2 * normalizedHeight ;
555+ const labelWorldY = pos . podiumHeight + estimatedBodyHeight + 0.9 ;
556+
557+ const v = new THREE . Vector3 ( pos . x , labelWorldY , 0 ) ;
548558 v . project ( camera ) ;
559+
549560 const sx = ( v . x + 1 ) / 2 * canvasW ;
550561 const sy = ( 1 - ( v . y + 1 ) / 2 ) * canvasH ;
551562
552- div . style . left = `${ sx } px` ;
553- div . style . top = `${ Math . max ( 6 , sy - 4 ) } px` ;
563+ div . style . left = `${ sx } px` ;
564+ div . style . top = `${ Math . max ( 8 , sy ) } px` ;
554565 div . style . transform = "translateX(-50%) translateY(-100%)" ;
555- div . style . width = "220px " ;
566+ div . style . width = "230px " ;
556567
557568 container . appendChild ( div ) ;
558569 }
0 commit comments