previous  contents

Appendix 4:
Guiding animation

A standard VRML syntax, which simulates moving around with a "car" (box) though the town when the user selects the option from the view menu. The highlighted co-ordinates are to be created with respect to the particular path.

#VRML V2.0 utf8
#March'97
#Sisi Zlatanova
# The carpet to move around
# … initial information about the world

Group {
    children [
        DEF Clock TimeSensor {
            enabled FALSE
            cycleInterval 4.0
            loop TRUE
        }
        DEF Car Transform {
            translation 110 3 -220
                children [
                    DEF CarView Viewpoint {
                        position 0 0 0
                        orientation 0 1 0 3.14
                        jump TRUE
                        description "on the carpet"
                    }

                    Shape {
                        appearance Appearance {
                            material Material {
                                diffuseColor 0.60 0.30 0.2
                                specularColor 0.8 0.8 0.8
                            }
                        }
                        geometry Box {size 2 0.1 3}
                    }
                ]
        }#end car

        DEF Path PositionInterpolator {
            key [ 0.0 0.10 0.20 0.30 0.4 0.50 0.6 0.7 0.8 0.9]
            keyValue [
                   130 3 -207
             150 3 -208
                   160 3 -208
                   170 3 -209
                   180 3 -209
                   190 3 -208
                   200 3 -200
                   210 3 -190
                   220 3 -180
                   230 3 -170
            ]
        }# … the description of the world

        ]
}

ROUTE CarView.isBound TO Clock.set_enabled
ROUTE Clock.fraction_changed TO Path.set_fraction
ROUTE Path.value_changed TO Car.set_translation



previous  contents