File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
src/sage/ext_data/threejs Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change 214
214
camera . up . set ( 0 , 0 , 1 ) ;
215
215
camera . position . set ( a [ 0 ] * xMid , a [ 1 ] * yMid , a [ 2 ] * zMid ) ;
216
216
217
- var offset = new THREE . Vector3 ( a [ 0 ] * xRange , a [ 1 ] * yRange , a [ 2 ] * zRange ) ;
217
+ // camera is positioned so that the line from the camera to the center
218
+ // of the bounding sphere of the objects makes an angle of 60 degrees with x-axis
219
+ // and an angle of 30 degrees with z-axis and the field of view of the camera looking
220
+ // at the center has an angle of 45 degrees.
221
+ const sin8 = Math . sin ( Math . PI / 8 ) ;
222
+ const sin5 = Math . sin ( Math . PI / 5 ) ;
223
+ const cos5 = Math . cos ( Math . PI / 5 ) ;
224
+ const sin3 = Math . sin ( Math . PI / 3 ) ;
225
+ const cos3 = Math . cos ( Math . PI / 3 ) ;
226
+ var r = midToCorner / sin8 ;
227
+ var offset = new THREE . Vector3 ( r * sin3 * cos5 , r * sin3 * sin5 , r * cos3 ) ;
218
228
219
229
if ( options . viewpoint ) {
220
230
569
579
setTimeout ( function ( ) { m . style . display = 'none' ; } , 2000 ) ;
570
580
571
581
}
572
-
582
+
573
583
</ script >
574
584
575
585
< div id ="menu-container " onclick ="toggleMenu() "> ⓘ
You can’t perform that action at this time.
0 commit comments