#VRML V2.0 utf8 NavigationInfo{ type "EXAMINE" } Viewpoint{ fieldOfView .2 position 0 0 40 description "[100]"} Viewpoint{ fieldOfView .2 position 28 0 28 orientation 0 1 0 .785 description "[110]"} Viewpoint{ fieldOfView .2 position 23 23 23 orientation -1 1 0 .955 description "[111]"} DEF XForm Transform{ children[ Shape{ appearance Appearance{ material Material{ emissiveColor 1 1 1 transparency .5}} geometry IndexedFaceSet{ solid FALSE coord Coordinate{ point[2 1 2,2 1 -2,-2 1 -2,-2 1 2,2 -1 2,2 -1 -2,-2 -1 -2,-2 -1 2]} coordIndex[0 1 2 3 -1 4 5 6 7]}} ]} Script{ field SFNode XForm USE XForm directOutput TRUE url ["javascript: function initialize() { var i,j,k, n=2, is=1,js,ks,BY, sum, Str = ''; for ( i= -n; i<= n; i++) { js = 1; sj=''; for ( j= -n; j<= n; j++) { ks = 1; BY=1; sk = ''; for ( k= -3; k<= 3; k++) { sum = is+js+ks; if (sum == 3) sk += 'Cu{ trans '+i+' '+k+' '+j+'}'; if ( (sum == 1)&& !(((k == 3)||(k == -3))&&(is < 0))&& !((k == 0)&&(ks < 0)) ) sk += 'O{ trans '+i+' '+k+' '+j+'}'; if (sum == -3){ BY = -BY; if (BY < 0) sk += 'Ba{ trans '+i+' '+k+' '+j+'}'; else sk += 'Y{ trans '+i+' '+k+' '+j+'}'; } ks = -ks;} sj += sk; js = -js;} Str += sj; is = -is;} XForm.addChildren = Browser.createVrmlFromString( 'PROTO Cu[ field SFVec3f trans 0 0 0]{'+ 'Transform{ translation IS trans children[ '+ 'Shape{ appearance Appearance{ material Material{ diffuseColor 1 1 0}}'+ 'geometry Sphere{ radius 0.15 }}]}}'+ 'PROTO Ba[ field SFVec3f trans 0 0 0]{'+ 'Transform{ translation IS trans children[ '+ 'Shape{ appearance Appearance{ material Material{ diffuseColor 0 0 1}}'+ 'geometry Sphere{ radius 0.3 }}]}}'+ 'PROTO Y[ field SFVec3f trans 0 0 0]{'+ 'Transform{ translation IS trans children[ '+ 'Shape{ appearance Appearance{ material Material{ diffuseColor 1 0 0}}'+ 'geometry Sphere{ radius 0.25 }}]}}'+ 'PROTO O[ field SFVec3f trans 0 0 0]{'+ 'Transform{ translation IS trans children[ '+ 'Shape{ appearance Appearance{ material Material{ diffuseColor 1 1 1}}'+ 'geometry Sphere{ radius 0.2 }}]}}' + Str ); }"] }