#VRML V2.0 utf8 #tetwq1.wrl #--------------------------------------- #設定 #--------------------------------------- #視点を設定する Viewpoint { position 0 -100 100 #視点の位置 orientation 1 0 0 0.78539816 #視線の方向 } #--------------------------------------- #線路部品 #--------------------------------------- #枕木(L5) PROTO Com_Sleeper1 [ field SFVec3f position 0 0 0 ] { #↓ここから Transform { children [ Transform { children [ Shape { geometry Box { #直方体 size 1.5 16 1.5 #長さ、巾、高さ } appearance Appearance { material Material { diffuseColor 0.5 0 0 #色 } } } ] translation 0 0 -2.75 } ] translation IS position } #↑ここまで } #--------------------------------------- #枕木2個(L10) PROTO Com_Sleeper2 [ field SFVec3f position 0 0 0 ] { #↓ここから Transform { children [ Com_Sleeper1{ position -2.5 0 0 } Com_Sleeper1{ position 2.5 0 0 } ] translation IS position } #↑ここまで } #--------------------------------------- #枕木4個(L20) PROTO Com_Sleeper4 [ field SFVec3f position 0 0 0 ] { #↓ここから Transform { children [ Com_Sleeper2{ position -5 0 0 } Com_Sleeper2{ position 5 0 0 } ] translation IS position } #↑ここまで } #--------------------------------------- #枕木8個(L40) PROTO Com_Sleeper8 [ field SFVec3f position 0 0 0 ] { #↓ここから Transform { children [ Com_Sleeper4{ position -10 0 0 } Com_Sleeper4{ position 10 0 0 } ] translation IS position } #↑ここまで } #--------------------------------------- #枕木16個(L80) PROTO Com_Sleeper16 [ field SFVec3f position 0 0 0 ] { #↓ここから Transform { children [ Com_Sleeper8{ position -20 0 0 } Com_Sleeper8{ position 20 0 0 } ] translation IS position } #↑ここまで } #--------------------------------------- #枕木32個(L160) PROTO Com_Sleeper32 [ field SFVec3f position 0 0 0 ] { #↓ここから Transform { children [ Com_Sleeper16{ position -40 0 0 } Com_Sleeper16{ position 40 0 0 } ] translation IS position } #↑ここまで } #--------------------------------------- #ジョイント PROTO Com_Joint1 [ field SFVec3f position 0 0 0 ] { #↓ここから Transform { children [ Transform { children [ Shape { geometry Box { #直方体 size 5 0.1 1 #長さ、巾、高さ } appearance Appearance { material Material { diffuseColor 0.5 0.5 0 #色 } } } ] translation 0 0 -1 } ] translation IS position } #↑ここまで } #--------------------------------------- #ジョイント2組 PROTO Com_Joint2 [ field SFVec3f position 0 0 0 ] { #↓ここから Transform { children [ Com_Joint1{ position 0 -0.35 0 } Com_Joint1{ position 0 0.35 0 } ] translation IS position } #↑ここまで } #--------------------------------------- #レール PROTO S124_Railpart1 [ field SFVec3f position 0 0 0 ] { #↓ここから Transform { children [ Shape { geometry Box { #直方体 size 124 0.6 1.5 #長さ、巾、高さ } appearance Appearance { material Material { diffuseColor 0.5 0.5 0 #色 } } } ] translation IS position } #↑ここまで } PROTO S124_Railpart2 [ field SFVec3f position 0 0 0 ] { #↓ここから Transform { children [ Shape { geometry Box { #直方体 size 124 1 0.5 #長さ、巾、高さ } appearance Appearance { material Material { diffuseColor 0.5 0.5 0 #色 } } } ] translation IS position } #↑ここまで } PROTO S124_Rail [ field SFVec3f position 0 0 0 ] { #↓ここから Transform { children [ S124_Railpart1{ position 0 0 -0.75 } S124_Railpart2{ position 0 0 -1.75 } ] translation IS position } #↑ここまで } #--------------------------------------- #線路S124 #--------------------------------------- PROTO S124 [ field SFVec3f position 0 0 0 ] { #↓ここから Transform { children [ #枕木 Com_Sleeper8{ position -40 0 0 } Com_Sleeper8{ position 0 0 0 } Com_Sleeper8{ position 40 0 0 } #線路 S124_Rail{ position 0 -4.8 0 } S124_Rail{ position 0 4.8 0 } #ジョイント Com_Joint2{ position -62 -4.8 0 } Com_Joint2{ position 62 4.8 0 } ] translation IS position } #↑ここまで } #--------------------------------------- #線路配置 #--------------------------------------- #S124{ # position 0 0 0 #} #--------------------------------------- #移動 #--------------------------------------- #動きの元を決める DEF Move_In TimeSensor { loop TRUE cycleInterval 10 stopTime -1 } #模型の動きを決める DEF Move_Out Transform { children S124 {} } #動きの元と模型の動きの関係を決める DEF Move_Rel PositionInterpolator { key [0, 0.25, 0.5, 0.75, 1] keyValue [0 0 0, -50 0 0, 0 0 0, 50 0 0, 0 0 0] } #以上を関連付ける ROUTE Move_In.fraction_changed TO Move_Rel.set_fraction ROUTE Move_Rel.value_changed TO Move_Out.set_translation