#VRML V2.0 utf8 # BUSY/IDLE Sphere in a sphere. #EXTERNPROTO SPHERE [ # exposedField SFVec3f translation # exposedField SFString picture #] "sphere.wrl" PROTO GLASS[] { Material { ambientIntensity 1 diffuseColor .4 .5 .4 emissiveColor 0 .0 .0 shininess 1.0 specularColor .7 .7 .7 transparency .6 } } PROTO BEAD[ field SFColor color 1 0 0] { Material { ambientIntensity 0.8 diffuseColor IS color emissiveColor 0 .0 .0 shininess .7 specularColor 0 .6 0 transparency 0.0 } } #Prototype of an icon PROTO SPHERE [ exposedField SFVec3f translation 0 0 0 exposedField SFInt32 numbeads 1 ] { Transform { translation IS translation children [ Shape { geometry Sphere { radius 0.5 } appearance Appearance { material GLASS{} } } Switch { choice [ Shape {} DEF ONEBEAD Shape { geometry Sphere { radius 0.3 } appearance Appearance { material BEAD{ color 0 0 1 } } } Transform { scale 0.5 0.5 0.5 children [ Transform { translation 0.4 0 0 children [ USE ONEBEAD ] } Transform { translation -0.4 0 0 children [ USE ONEBEAD ] } ] } Transform { scale 0.5 0.5 0.5 children [ Transform { translation 0.5 -.2 0 children [ USE ONEBEAD ] } Transform { translation -0.5 -.2 0 children [ USE ONEBEAD ] } Transform { translation 0 .3 0 children [ USE ONEBEAD ] } ] } ] whichChoice IS numbeads } ] } } SPHERE { translation 0 0 0 numbeads 0} SPHERE { translation 2 0 0 numbeads 1} SPHERE { translation 4 0 0 numbeads 2} SPHERE { translation 6 0 0 numbeads 3}