@@ -295,21 +295,23 @@ <h1>Shader Filters</h1>
295295}
296296
297297function platonicGroup ( scene ) {
298+ var size = 4.5 ;
299+ var dims = size * 2 / Math . sqrt ( 3 ) ;
298300 var mesh = Meshes . createBox ( dims , dims , dims ) ;
299301 var group = new ShapeGroup ( ) ;
300302 group . addShape (
301303 scene . makeShape ( mesh ) . setMaterial ( shiny ( "red" ) ) . setPosition ( - 15 , 5 , 0 ) )
302304 // this configuration of a sphere results in an octahedron
303- mesh = Meshes . createSphere ( 4.5 , 4 , 2 , true ) ;
305+ mesh = Meshes . createSphere ( size , 4 , 2 , true ) ;
304306 group . addShape (
305307 scene . makeShape ( mesh ) . setMaterial ( shiny ( "blue" ) ) . setPosition ( - 5 , 5 , 0 ) )
306- mesh = icosahedron ( 4.5 ) ;
308+ mesh = icosahedron ( size ) ;
307309 group . addShape (
308310 scene . makeShape ( mesh ) . setMaterial ( shiny ( "lime" ) ) . setPosition ( 5 , 5 , 0 ) )
309- mesh = tetrahedron ( 4.5 ) ;
311+ mesh = tetrahedron ( size ) ;
310312 group . addShape (
311313 scene . makeShape ( mesh ) . setMaterial ( shiny ( "darkorange" ) ) . setPosition ( 15 , 5 , 0 ) )
312- mesh = dodecahedron ( 4.5 ) ;
314+ mesh = dodecahedron ( size ) ;
313315 group . addShape (
314316 scene . makeShape ( mesh ) . setMaterial ( shiny ( "yellow" ) ) . setPosition ( - 15 , - 5 , 0 ) )
315317 return group
@@ -326,7 +328,7 @@ <h1>Shader Filters</h1>
326328 var yy = ( ( y / 100 ) + 1 ) / 2
327329 var mesh = Meshes . createPlane ( 0.2 , 0.2 ) ;
328330 group . addShape ( scene . makeShape ( mesh )
329- . setColor ( color ? [ 0 , xx , yy ] : "white" )
331+ . setColor ( color ? [ 0 , xx , yy ] : [ 1 , 0.7 , 0.7 ] )
330332 . setPosition ( x / 100 + 0.1 , y / 100 + 0.1 , 0 ) ) ;
331333 color = ! color ;
332334 }
@@ -338,7 +340,7 @@ <h1>Shader Filters</h1>
338340 // Create the 3D scene; find the HTML canvas and pass it
339341 // to Scene3D.
340342 var scene = new Scene3D ( ( document . getElementById ( "canvas" ) ) ) ;
341- var dims = 4.5 * 2 / Math . sqrt ( 3 ) ;
343+ scene . setClearColor ( "white" )
342344 var blinds = blindsGroup ( scene )
343345 var platonic = platonicGroup ( scene )
344346 linknone ( ) ;
0 commit comments