#VRML V2.0 utf8 WorldInfo{ info[ "CosmoWorlds ClipArt (c)1998 spotlight scene - pioneer@sgi.com" ] } PROTO X [ exposedField SFVec3f T 0 0 0 exposedField SFVec3f S 1 1 1 exposedField SFRotation R 0 1 0 0 exposedField SFColor C .01 .01 .01 exposedField SFFloat Z 0 exposedField MFString img [] exposedField SFVec2f imgT 0 0 exposedField SFVec2f imgS 4 18 field SFNode G IndexedFaceSet{ coord Coordinate{ point[1 -1 0, 1 1 0, -1 1 0, -1 -1 0] } coordIndex[0,1,2,3,-1] } ]{ Transform{ translation IS T rotation IS R scale IS S children[ Shape{ appearance Appearance{ material Material{ diffuseColor IS C transparency IS Z } texture ImageTexture{ url IS img } textureTransform TextureTransform{ translation IS imgT scale IS imgS } } geometry IS G } ] } } PROTO Y[ exposedField SFVec3f T 0 0 0 exposedField SFVec3f S 1 1 1 exposedField SFRotation R 0 1 0 0 exposedField MFNode H [] ]{ Transform{ translation IS T rotation IS R scale IS S children IS H } } DEF Nav0 NavigationInfo{ type "WALK" headlight FALSE avatarSize[.1 1 .1] } DEF View0 Viewpoint{ position -2.5 1 -5.5 orientation 0 1 0 -2.4 description "~shadow~" fieldOfView 1.5 } DEF View1 Viewpoint{ position 1 1 2 orientation 0 1 0 .2 description "~spotlight~" fieldOfView 1.5 } DEF Light0 DirectionalLight{direction -1 -1 -1 intensity .7} DEF Light1 DirectionalLight{direction 1 -1 -1 intensity .4} DEF Lamp Y{H[ Y{H[ DEF Drag0 PlaneSensor{minPosition 0 0 maxPosition 3 3} PointLight{location -1.5 .2 0} X{T -1.5 .2 .03 R 1 0 0 1.57079 S .1 .08 .1 C 0 0 1 G Cylinder{}} X{T -1.5 .2 -.02 R 1 0 0 1.57079 S .12 .12 .12 C 0 0 1 G Cone{bottom FALSE}} Y{T -1.5 .2 -.05 S .05 .05 .05 H[Shape{geometry Sphere{}}]} ]} ]} ROUTE Drag0.translation_changed TO Lamp.set_T DEF Room Y{S 2 2 2 H[ Y{T 0 0 -3 S 2 1 1 H[ DEF Wall Y{H[ X{T 0 1.33 0 S 1 .67 1 C 0 .4 .1} X{T 0 .33 0 S 1 .33 1 C .8 .5 0} X{T 0 .66 0 R 0 0 1 1.57079 S .02 1 .05 C .5 .28 .25 G Cylinder{}} X{T 0 0 0 R 0 0 1 1.57079 S .02 1 .05 C .5 .28 .25 G Cylinder{}} ]} ]} Y{T -2 0 0 R 0 1 0 1.57079 S 3 1 1 H[USE Wall ]} Y{T 2 0 0 R 0 1 0 -1.57079 S 3 1 1 H[USE Wall ]} Y{T 0 0 3 R 0 1 0 3.14159 S 2 1 1 H[USE Wall ]} DEF Floor X{T 0 0 0 R 1 0 0 -1.57079 S 2 3 1 C 1 1 1 img "tile.jpg" } DEF Ceiling X{T 0 2 0 R 1 0 0 1.57079 S 2 3 1 C 1 1 1} ]} DEF allBall Y{H[Y{T 0 0 -3 H[ X{T 0 .2 0 S .2 .2 .2 C 1 0 0 G Sphere{}} DEF Shadow0 Y{H[ X{T 0 0 -.5 S .25 .005 .5 C 0 0 0 Z .5 G Sphere{}} ]} DEF Shadow1 Y{H[ X{T 0 .2 -4 S .4 .4 .04 C 0 0 0 Z .5 G Sphere{}} ]} ]}]} DEF Script0 Script{ eventIn SFVec3f XXX field SFNode shadow0 USE Shadow0 field SFNode shadow1 USE Shadow1 field SFVec3f shadow0scale 1 1 1 field SFVec3f shadow1scale 1 1 1 field SFRotation shadow0rot 0 1 0 0 field SFVec3f shadow1move 1 0 1 field SFVec3f startVal 0 0 0 directOutput TRUE url "vrmlscript: function XXX(v){ shadow0scale[2] = 5-(4.5*v[1]/3); shadow0scale[0] = 2-v[1]/3; shadow0rot[3] = -.5+(v[0]/3); shadow0.set_S = shadow0scale; shadow0.set_R = shadow0rot; shadow1move[0] = 1.5-(3*v[0]/3); shadow1move[1] = -1.7*v[1]/3; shadow1scale[0] = 1.2+Math.abs(.8-(1.6*v[0]/3)); shadow1.set_T = shadow1move; shadow1.set_S = shadow1scale; } function initialize(){ XXX(startVal); } " } ROUTE Drag0.translation_changed TO Script0.XXX