#VRML V2.0 utf8 # 5.2 Zwischenschritt: Drehen einer Wand (als ›bung zum Ùffnen der Schachtel) Background { skyColor 0.35 0.7 1 } DEF Kamera Viewpoint { fieldOfView 0.5 position -15 30 90 orientation -1 -1 0 0.5 } # Die senkrechte Wand: Transform { rotation 0 0 1 4.70 translation -5 -5 0 children Shape { appearance Appearance { material Material {diffuseColor 1 1 0} } geometry Box { size 10 0.3 20 } } } # Der Deckel, der sich ÷ffnen soll: DEF Deckel Transform { center -5 0 0 children Shape { appearance Appearance { material Material {diffuseColor 1 0.5 0.4} } geometry Box { size 10 0.3 20 } } } # Eine (Dreh-)Achse: Transform { translation -5 0 0 rotation 1 0 0 1.57 children Shape { appearance Appearance { material Material {diffuseColor 0 0.2 0} } geometry Cylinder { height 20.4 radius 0.2 } } } # Die Animation durch eine Zeitschleife: DEF Clock TimeSensor { cycleInterval 10.0 # stopTime 15.0 loop TRUE } # Der Interpolator: DEF Orient OrientationInterpolator { key [ 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 ] keyValue [ 0 0 1 0.0, 0 0 0 0.0, 0 0 1 0.5, 0 0 1 1, 0 0 1 1.5, 0 0 1 2.0, 0 0 1 2.5, 0 0 1 3, 0 0 1 3.5, 0 0 1 3.5 ] } # Die Verdrahtung: ROUTE Clock.fraction_changed TO Orient.set_fraction ROUTE Orient.value_changed TO Deckel.set_rotation