@@ -5,20 +5,12 @@ import * as THREE from 'three';
55const Pedestrian = ( { pedestrian, coordinateTransformer } ) => {
66 const { pos, state, id, color, satisfaction, resources } = pedestrian ;
77 const [ pedPosition , setPedPosition ] = useState ( null ) ;
8- const [ orientation , setOrientation ] = useState ( new THREE . Quaternion ( ) ) ;
98
109 useEffect ( ( ) => {
1110 if ( coordinateTransformer ) {
1211 const [ lat , lng ] = pos ;
1312 const vector = coordinateTransformer . latLngToECEF ( lat , lng , 1 ) ; // Elevate slightly
1413 setPedPosition ( vector ) ;
15-
16- const up = vector . clone ( ) . normalize ( ) ;
17- const newOrientation = new THREE . Quaternion ( ) . setFromUnitVectors (
18- new THREE . Vector3 ( 0 , 1 , 0 ) , // Default model's 'up'
19- up // Target 'up' on the globe
20- ) ;
21- setOrientation ( newOrientation ) ;
2214 }
2315 } , [ pos , coordinateTransformer ] ) ;
2416
@@ -53,7 +45,7 @@ const Pedestrian = ({ pedestrian, coordinateTransformer }) => {
5345 const scale = 6 ; // Made slightly smaller to fit more pedestrians
5446
5547 return (
56- < group position = { pedPosition } quaternion = { orientation } >
48+ < group position = { pedPosition } >
5749 < group position = { [ 0 , 6 , 0 ] } >
5850 { /* Head - colored by satisfaction */ }
5951 < mesh position = { [ 0 , 0.75 * scale , 0 ] } >
0 commit comments