@@ -638,6 +638,29 @@ function onResults(results) {
638
638
if ( landmarks ) {
639
639
drawConnectors ( canvasCtx , landmarks , HAND_CONNECTIONS , { color : color , lineWidth : 2 } ) ;
640
640
drawLandmarks ( canvasCtx , landmarks , { color : dotColor , lineWidth : 1 , radius : 3 } ) ;
641
+
642
+ // --- Draw hand function label ---
643
+ const wrist = landmarks [ 0 ] ; // Use wrist as reference point
644
+ const labelText = isLeft ? "Zoom" : "Rotate" ;
645
+
646
+ // Position label near but slightly offset from the wrist
647
+ const labelX = wrist . x * canvasElement . width - ( isLeft ? - 30 : 30 ) ;
648
+ const labelY = wrist . y * canvasElement . height - 25 ;
649
+
650
+ // Draw text with shadow for better visibility
651
+ canvasCtx . save ( ) ; // Save the current state
652
+
653
+ // Apply counter-transformation to make text readable (flip horizontally)
654
+ canvasCtx . scale ( - 1 , 1 ) ;
655
+ const flippedX = - labelX ; // Negate x position for proper placement after flip
656
+
657
+ canvasCtx . font = "32px 'Courier New', monospace" ;
658
+ canvasCtx . fillStyle = "rgba(0, 0, 0, 1.0)" ; // Shadow
659
+ canvasCtx . fillText ( labelText , flippedX + 2 , labelY + 2 ) ;
660
+ canvasCtx . fillStyle = "white" ; // White text
661
+ canvasCtx . fillText ( labelText , flippedX , labelY ) ;
662
+
663
+ canvasCtx . restore ( ) ; // Restore the previous state
641
664
}
642
665
}
643
666
@@ -797,7 +820,7 @@ function setupBloom() {
797
820
// Add the UnrealBloomPass with nice default values for particles
798
821
const bloomPass = new THREE . UnrealBloomPass (
799
822
new THREE . Vector2 ( window . innerWidth , window . innerHeight ) , // resolution
800
- 1.5 , // strength (intensity of the bloom)
823
+ 1.3 , // strength (intensity of the bloom)
801
824
0.1 , // radius (how far the bloom extends)
802
825
0.1 , // threshold (minimum brightness to apply bloom)
803
826
) ;
0 commit comments