File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1111 // User stands BEHIND the cube, sees Yellow (right hand) on left, Blue (left hand) on right.
1212 const camera = new THREE . PerspectiveCamera ( 25 , 1 , 0.1 , 1000 ) ;
1313 camera . position . set ( 0 , 2 , - 4 ) ;
14- const initialCameraPosition = camera . position . clone ( ) ;
14+ let initialCameraPosition = camera . position . clone ( ) ;
1515
1616 // Renderer
1717 const renderer = new THREE . WebGLRenderer ( { antialias : true , powerPreference : 'high-performance' , alpha : true } ) ;
360360 controls . maxDistance = Math . max ( distance * 1.8 , controls . minDistance + 0.1 ) ;
361361 controls . update ( ) ;
362362 }
363+
364+ initialCameraPosition = camera . position . clone ( ) ;
363365 }
364366
365367 fitCameraToObject ( keycubeGroup , camera , controls ) ;
470472
471473 if ( data . resetView ) {
472474 camera . position . copy ( initialCameraPosition ) ;
473- controls . target . copy ( initialControlsTarget ) ;
474475 autoRotateStoppedByUser = false ;
475476 controls . autoRotate = true ;
476- camera . zoom = 1 ;
477- camera . updateProjectionMatrix ( ) ;
478- controls . update ( ) ;
479477 fitCameraToObject ( keycubeGroup , camera , controls ) ;
480478 }
481479
You can’t perform that action at this time.
0 commit comments