#VRML V2.0 utf8 WorldInfo { title "DropSensor Test2" info [ "2000/12/8 by GoGoGo" "http://www1.plala.or.jp/Studio_GoGoGo/" ] } Viewpoint {position 0 13 14 orientation 1 0 0 -0.7 description "initial"} #ドロップした位置が DropSensor から外れてると、ドロップした WRLファイルにジャンプしてしまう。 #これを防ぐためにダミーの DropSensor を書いておく。 DropSensor {} #オブジェ DEF obj Group{} #ホワイトボード Shape { appearance Appearance { material Material {emissiveColor 0.4 0.4 0.4} } geometry IndexedFaceSet { coord Coordinate {point [-10 0 6, 10 0 6, 10 0 -6, -10 0 -6]} coordIndex [0 1 2 3] } } #ピンクのエリア Transform { translation 0 0.01 0 children [ DEF DS DropSensor {} Shape { appearance Appearance { material Material {diffuseColor 0 0 0 emissiveColor 1 0.5 1} } geometry IndexedFaceSet { coord Coordinate {point [-1 0 1, 1 0 1, 1 0 -1, -1 0 -1]} coordIndex [0 1 2 3] } } ] } #スクリプト DEF SC Script { eventIn MFString URL eventIn MFNode loaded eventOut MFNode addChildren field SFNode myself USE SC url "javascript: function URL(value){ Browser.createVrmlFromURL(value,myself,'loaded'); } function loaded(newObj){ addChildren=newObj; }" } ROUTE DS.url TO SC.URL ROUTE SC.addChildren TO obj.addChildren