/***** ** DIVE town. ****** ** Author: Emmanuel Frécon emmanuel@sics.se ******/ #include "dive.vh" #include "town_houses.vh" #include "street_lamp.vh" #include "road_lamp.vh" #include "traffic_lights.vh" #include "trees.vh" #include "road_signs.vh" #include "stock_house.vh" #include "school.vh" #include "office.vh" #include "church.vh" #include "bench.vh" #include "watertower.vh" /* The following constant defines the complexity of the scene. LOD 0: Everything is drawn. LOD 1: Some details in some unimportant objects are taken away (ex. the under polygons of the trees). LOD 2: The Road signs and Traffic Lights are taken away. LOD 3: The Benches and Street lamps are Taken away. LOD 4: The Road Lamps and the water tower are taken away. LOD 5: The Trees are taken away. */ #ifndef LOD #define LOD 3 #endif #undef STATIC_OBJECTS /* Material Used for the pavements */ #define PAVEMENT_MAT "GREY_BROWN_M" /* Material Used for the grass */ #define GRASS_MAT "GRASS_GREEN" /* Material Used for the Road */ #define ROAD_MAT "HOUSE1_WINDOW" /* Level of the road (under the floor) */ #define ROAD_LEVEL -0.2 /* Constants defining the speed of the car. MOVE_DIST have to give 0.5 when multiplied by some integer constant */ #define MOVE_DIST (0.5) #define MOVE_FREQ (20) /* Constant defining the altitude of the gateway to the solar system */ #define SKY_LEVEL (100) world "Dive_town.sics.se" { start v -2.5 0 -120.0 min v -1e+20 0 -1e+20 max v 1e+20 1e+20 1e+20 background 0.2 0.5 0.7 fog 0.0003 info "A virtual town with many portals and two automated driving jeeps." } /* Making the map... Placing pavements and grass */ /* The entry road, with place for some trees in the middle of the road */ object { material GRASS_MAT gouraud on #ifdef STATIC_OBJECTS static_rec on #endif view 0 { BOXVECTOR 18 /* The entry road, with place for some trees in the middle of the road */ RBOX v -300 ROAD_LEVEL -300.0 v -6.5 0.0 -150 RBOX v -90.0 ROAD_LEVEL -145.0 v -6.5 0.0 -2.0 RBOX v -300.0 ROAD_LEVEL -150.0 v -95.0 0.0 -2.0 RBOX v 6.5 ROAD_LEVEL -300.0 v 300 0.0 -2 RBOX v -0.5 ROAD_LEVEL -100.0 v 0.5 0.0 0.0 /* The "Island" of houses, created by the hole of the market place */ RBOX v -22.0 ROAD_LEVEL 8.0 v 48.0 0.0 54.0 RBOX v -68.0 ROAD_LEVEL 8.0 v -22.0 0.0 104.0 /* The rest, with space for the market place */ RBOX v 300.0 ROAD_LEVEL 8.0 v 57.0 0.0 54.0 RBOX v 300.0 ROAD_LEVEL 54.0 v 152.0 0.0 95.0 RBOX v 300.0 ROAD_LEVEL 100.0 v 152.0 0.0 202.0 RBOX v 300.0 ROAD_LEVEL 202.0 v -300.0 0.0 300.0 RBOX v -22.0 ROAD_LEVEL 113.0 v -300.0 0.0 202.0 RBOX v -77.0 ROAD_LEVEL 8.0 v -300.0 0.0 50.0 RBOX v -77.0 ROAD_LEVEL 54.0 v -300.0 0.0 113.0 /* Grass around the church (it is not really the place to describe it, but this speeds up rendering) */ RBOX v 70.0 ROAD_LEVEL 130.0 v 35.0 0.0 110.0 RBOX v 85.0 ROAD_LEVEL 120.0 v 20.0 0.0 130.0 RBOX v 85.0 ROAD_LEVEL 120.0 v 75.0 0.0 170.0 RBOX v 30.0 ROAD_LEVEL 120.0 v 20.0 0.0 170.0 } } object { material PAVEMENT_MAT gouraud on #ifdef STATIC_OBJECTS static_rec on #endif view 0 { BOXVECTOR 28 /* The entry road, with place for some trees in the middle of the road */ RBOX v -6.5 ROAD_LEVEL 0.0 v -4.5 0.0 -145.0 RBOX v -6.5 ROAD_LEVEL -150.0 v -4.5 0.0 -300.0 RBOX v -6.5 ROAD_LEVEL -2.0 v -90.0 0.0 0.0 RBOX v -95 ROAD_LEVEL -2.0 v -300.0 0.0 0.0 RBOX v 4.5 ROAD_LEVEL 0.0 v 6.5 0.0 -300 RBOX v 6.5 ROAD_LEVEL -2.0 v 300 0.0 0.0 /* The "Island" of houses, created by the hole of the market place */ RBOX v 50.0 ROAD_LEVEL 6.0 v 48.0 0.0 56.0 RBOX v 48.0 ROAD_LEVEL 54.0 v -20.0 0.0 56.0 RBOX v -20.0 ROAD_LEVEL 54.0 v -22.0 0.0 106.0 RBOX v -22.0 ROAD_LEVEL 104.0 v -68.0 0.0 106.0 RBOX v -68.0 ROAD_LEVEL 106.0 v -70.0 0.0 6.0 RBOX v 48.0 ROAD_LEVEL 6.0 v -68.0 0.0 8.0 /* The rest, with space for the market place */ RBOX v 300.0 ROAD_LEVEL 6.0 v 55.0 0.0 8.0 RBOX v 57.0 ROAD_LEVEL 8.0 v 55.0 0.0 54.0 RBOX v 152.0 ROAD_LEVEL 54.0 v 55.0 0.0 56.0 RBOX v 152.0 ROAD_LEVEL 56.0 v 150.0 0.0 95.0 RBOX v 152.0 ROAD_LEVEL 100.0 v 150.0 0.0 200.0 RBOX v 152.0 ROAD_LEVEL 200.0 v -22.0 0.0 202.0 RBOX v -20.0 ROAD_LEVEL 200.0 v -22.0 0.0 113.0 RBOX v -20.0 ROAD_LEVEL 111.0 v -77.0 0.0 113.0 RBOX v -75.0 ROAD_LEVEL 50.0 v -77.0 0.0 8.0 RBOX v -75.0 ROAD_LEVEL 111.0 v -77.0 0.0 54.0 RBOX v -75.0 ROAD_LEVEL 6.0 v -300.0 0.0 8.0 /* Pavement on the market place */ RBOX v 145.0 ROAD_LEVEL 61.0 v 60.0 0.0 71.0 RBOX v 145.0 ROAD_LEVEL 71.0 v 135.0 0.0 195.0 RBOX v 135.0 ROAD_LEVEL 195.0 v -5.0 0.0 185.0 RBOX v -5.0 ROAD_LEVEL 195.0 v -15.0 0.0 71.0 RBOX v 45.0 ROAD_LEVEL 71.0 v -15.0 0.0 61.0 } } /* The roads */ object { material ROAD_MAT gouraud on #ifdef STATIC_OBJECTS static_rec on #endif view 0 { N_M_POLY 10 40 0 N_POLY 4 v -4.5 ROAD_LEVEL -300 v -4.5 ROAD_LEVEL 0.0 v 4.5 ROAD_LEVEL 0.0 v 4.5 ROAD_LEVEL -300 N_POLY 4 v -300.0 ROAD_LEVEL 0.0 v -300.0 ROAD_LEVEL 6.0 v 300.0 ROAD_LEVEL 6.0 v 300.0 ROAD_LEVEL 0.0 N_POLY 4 v -95.0 ROAD_LEVEL -150.0 v -95.0 ROAD_LEVEL 0.0 v -90.0 ROAD_LEVEL 0.0 v -90.0 ROAD_LEVEL -150.0 N_POLY 4 v -90.0 ROAD_LEVEL -150.0 v -90.0 ROAD_LEVEL -145.0 v -4.5 ROAD_LEVEL -145.0 v -4.5 ROAD_LEVEL -150.0 N_POLY 4 v -75.0 ROAD_LEVEL 6.0 v -75.0 ROAD_LEVEL 111.0 v -70.0 ROAD_LEVEL 111.0 v -70.0 ROAD_LEVEL 6.0 N_POLY 4 v -300.0 ROAD_LEVEL 50.0 v -300.0 ROAD_LEVEL 54.0 v -75.0 ROAD_LEVEL 54.0 v -75.0 ROAD_LEVEL 50.0 N_POLY 4 v -70.0 ROAD_LEVEL 106.0 v -70.0 ROAD_LEVEL 111.0 v -20.0 ROAD_LEVEL 111.0 v -20.0 ROAD_LEVEL 106.0 N_POLY 4 v -20.0 ROAD_LEVEL 56.0 v -20.0 ROAD_LEVEL 200.0 v 150.0 ROAD_LEVEL 200.0 v 150.0 ROAD_LEVEL 56.0 N_POLY 4 v 300.0 ROAD_LEVEL 95.0 v 150.0 ROAD_LEVEL 95.0 v 150.0 ROAD_LEVEL 100.0 v 300.0 ROAD_LEVEL 100.0 N_POLY 4 v 50.0 ROAD_LEVEL 6.0 v 50.0 ROAD_LEVEL 56.0 v 55.0 ROAD_LEVEL 56.0 v 55.0 ROAD_LEVEL 6.0 } } /* Traffic Lights */ #if LOD < 2 object { translation v -5.0 0.0 -0.5 #ifdef STATIC_OBJECTS static_rec on #endif traffic_lights(2.5, "BOTTLE_GREEN_M") } object { translation v -5.0 0.0 6.5 fixedxyz v 0.0 1.5707963 0.0 #ifdef STATIC_OBJECTS static_rec on #endif traffic_lights(2.5, "BOTTLE_GREEN_M") } object { translation v 5.0 0.0 -0.5 fixedxyz v 0.0 -1.5707963 0.0 #ifdef STATIC_OBJECTS static_rec on #endif traffic_lights(2.5, "BOTTLE_GREEN_M") } #endif /* Priority road signs */ #if LOD < 2 object { translation v 49.5 0.0 55.5 #ifdef STATIC_OBJECTS static_rec on #endif priority_road_sign(2.0, "HOUSE1_WALL") } object { translation v -95.5 0.0 -0.5 #ifdef STATIC_OBJECTS static_rec on #endif priority_road_sign(2.0, "HOUSE1_WALL") } object { translation v -20.5 0.0 111.5 fixedxyz v 0.0 1.5707963 0.0 #ifdef STATIC_OBJECTS static_rec on #endif priority_road_sign(2.0, "HOUSE1_WALL") } object { translation v -75.5 0.0 54.5 fixedxyz v 0.0 1.5707963 0.0 #ifdef STATIC_OBJECTS static_rec on #endif priority_road_sign(2.0, "HOUSE1_WALL") } object { translation v -69.5 0.0 6.5 fixedxyz v 0.0 3.1415927 0.0 #ifdef STATIC_OBJECTS static_rec on #endif priority_road_sign(2.0, "HOUSE1_WALL") } object { translation v -5.0 0.0 -144.5 fixedxyz v 0.0 1.5707963 0.0 #ifdef STATIC_OBJECTS static_rec on #endif priority_road_sign(2.0, "HOUSE1_WALL") } #endif /* Street Lights */ #if LOD < 3 object { translation v -5.0 0.0 -10.0 #ifdef STATIC_OBJECTS static_rec on #endif street_lamp(2.0, "HOUSE1_ROOF", "HOUSE1_WALL") } object { translation v 5.0 0.0 -10.0 #ifdef STATIC_OBJECTS static_rec on #endif street_lamp(2.0, "HOUSE1_ROOF", "HOUSE1_WALL") } object { translation v -5.0 0.0 -30.0 #ifdef STATIC_OBJECTS static_rec on #endif street_lamp(2.0, "HOUSE1_ROOF", "HOUSE1_WALL") } object { translation v 5.0 0.0 -30.0 #ifdef STATIC_OBJECTS static_rec on #endif street_lamp(2.0, "HOUSE1_ROOF", "HOUSE1_WALL") } object { translation v -5.0 0.0 -50.0 #ifdef STATIC_OBJECTS static_rec on #endif street_lamp(2.0, "HOUSE1_ROOF", "HOUSE1_WALL") } object { translation v 5.0 0.0 -50.0 #ifdef STATIC_OBJECTS static_rec on #endif street_lamp(2.0, "HOUSE1_ROOF", "HOUSE1_WALL") } object { translation v -5.0 0.0 -70.0 #ifdef STATIC_OBJECTS static_rec on #endif street_lamp(2.0, "HOUSE1_ROOF", "HOUSE1_WALL") } object { translation v 5.0 0.0 -70.0 #ifdef STATIC_OBJECTS static_rec on #endif street_lamp(2.0, "HOUSE1_ROOF", "HOUSE1_WALL") } object { translation v -5.0 0.0 -90.0 #ifdef STATIC_OBJECTS static_rec on #endif street_lamp(2.0, "HOUSE1_ROOF", "HOUSE1_WALL") } object { translation v 5.0 0.0 -90.0 #ifdef STATIC_OBJECTS static_rec on #endif street_lamp(2.0, "HOUSE1_ROOF", "HOUSE1_WALL") } #endif /* Road lights */ #if LOD < 4 object { translation v -5.0 0.0 -120.0 #ifdef STATIC_OBJECTS static_rec on #endif road_lamp(4.0, "HOUSE1_ROOF", "HOUSE1_WALL") } object { translation v 5.0 0.0 -150.0 fixedxyz v 0.0 3.1415927 0.0 #ifdef STATIC_OBJECTS static_rec on #endif road_lamp(4.0, "HOUSE1_ROOF", "HOUSE1_WALL") } object { translation v -5.0 0.0 -180.0 #ifdef STATIC_OBJECTS static_rec on #endif road_lamp(4.0, "HOUSE1_ROOF", "HOUSE1_WALL") } object { translation v 5.0 0.0 -210.0 fixedxyz v 0.0 3.1415927 0.0 #ifdef STATIC_OBJECTS static_rec on #endif road_lamp(4.0, "HOUSE1_ROOF", "HOUSE1_WALL") } object { translation v -5.0 0.0 -240.0 #ifdef STATIC_OBJECTS static_rec on #endif road_lamp(4.0, "HOUSE1_ROOF", "HOUSE1_WALL") } object { translation v 5.0 0.0 -270.0 fixedxyz v 0.0 3.1415927 0.0 #ifdef STATIC_OBJECTS static_rec on #endif road_lamp(4.0, "HOUSE1_ROOF", "HOUSE1_WALL") } object { translation v -5.0 0.0 -300.0 #ifdef STATIC_OBJECTS static_rec on #endif road_lamp(4.0, "HOUSE1_ROOF", "HOUSE1_WALL") } object { translation v -140.0 0.0 6.5 fixedxyz v 0.0 1.5707963 0.0 #ifdef STATIC_OBJECTS static_rec on #endif road_lamp(4.0, "HOUSE1_ROOF", "HOUSE1_WALL") } object { translation v -110.0 0.0 -0.5 fixedxyz v 0.0 -1.5707963 0.0 #ifdef STATIC_OBJECTS static_rec on #endif road_lamp(4.0, "HOUSE1_ROOF", "HOUSE1_WALL") } object { translation v -80.0 0.0 6.5 fixedxyz v 0.0 1.5707963 0.0 #ifdef STATIC_OBJECTS static_rec on #endif road_lamp(4.0, "HOUSE1_ROOF", "HOUSE1_WALL") } object { translation v -50.0 0.0 -0.5 fixedxyz v 0.0 -1.5707963 0.0 #ifdef STATIC_OBJECTS static_rec on #endif road_lamp(4.0, "HOUSE1_ROOF", "HOUSE1_WALL") } object { translation v -20.0 0.0 6.5 fixedxyz v 0.0 1.5707963 0.0 #ifdef STATIC_OBJECTS static_rec on #endif road_lamp(4.0, "HOUSE1_ROOF", "HOUSE1_WALL") } object { translation v 10.0 0.0 -0.5 fixedxyz v 0.0 -1.5707963 0.0 #ifdef STATIC_OBJECTS static_rec on #endif road_lamp(4.0, "HOUSE1_ROOF", "HOUSE1_WALL") } object { translation v 40.0 0.0 6.5 fixedxyz v 0.0 1.5707963 0.0 #ifdef STATIC_OBJECTS static_rec on #endif road_lamp(4.0, "HOUSE1_ROOF", "HOUSE1_WALL") } object { translation v 70.0 0.0 -0.5 fixedxyz v 0.0 -1.5707963 0.0 #ifdef STATIC_OBJECTS static_rec on #endif road_lamp(4.0, "HOUSE1_ROOF", "HOUSE1_WALL") } object { translation v 100.0 0.0 6.5 fixedxyz v 0.0 1.5707963 0.0 #ifdef STATIC_OBJECTS static_rec on #endif road_lamp(4.0, "HOUSE1_ROOF", "HOUSE1_WALL") } object { translation v 130.0 0.0 -0.5 fixedxyz v 0.0 -1.5707963 0.0 #ifdef STATIC_OBJECTS static_rec on #endif road_lamp(4.0, "HOUSE1_ROOF", "HOUSE1_WALL") } #endif /* Trees at the entry of the town */ #if LOD < 5 object { translation v 0.0 0.0 -15.0 #ifdef STATIC_OBJECTS static_rec on #endif #if LOD == 0 complex_deciduous_tree(2.5, "TREES_TRUNK", "TREES_GROUND") #else simple_deciduous_tree(2.5, "TREES_TRUNK", "TREES_GROUND") #endif } object { translation v 0.0 0.0 -30.0 #ifdef STATIC_OBJECTS static_rec on #endif #if LOD == 0 complex_deciduous_tree(3.0, "TREES_TRUNK", "TREES_GROUND") #else simple_deciduous_tree(3.0, "TREES_TRUNK", "TREES_GROUND") #endif } object { translation v 0.0 0.0 -45.0 #ifdef STATIC_OBJECTS static_rec on #endif #if LOD == 0 complex_deciduous_tree(3.5, "TREES_TRUNK", "TREES_GROUND") #else simple_deciduous_tree(3.5, "TREES_TRUNK", "TREES_GROUND") #endif } object { translation v 0.0 0.0 -60.0 #ifdef STATIC_OBJECTS static_rec on #endif #if LOD == 0 complex_deciduous_tree(4.0, "TREES_TRUNK", "TREES_GROUND") #else simple_deciduous_tree(4.0, "TREES_TRUNK", "TREES_GROUND") #endif } object { translation v 0.0 0.0 -75.0 #ifdef STATIC_OBJECTS static_rec on #endif #if LOD == 0 complex_deciduous_tree(4.5, "TREES_TRUNK", "TREES_GROUND") #else simple_deciduous_tree(4.5, "TREES_TRUNK", "TREES_GROUND") #endif } object { translation v 0.0 0.0 -90.0 #ifdef STATIC_OBJECTS static_rec on #endif #if LOD == 0 complex_deciduous_tree(5.0, "TREES_TRUNK", "TREES_GROUND") #else simple_deciduous_tree(5.0, "TREES_TRUNK", "TREES_GROUND") #endif } #endif /* Houses */ /* First corner on the left, when arriving */ object { translation v -12.0 0.0 -8.0 #ifdef STATIC_OBJECTS static_rec on #endif town_house1_gateway(8.0, 4.5, 6.0, "HOUSE1_WALL", "HOUSE1_ROOF", "HOUSE1_WINDOW", "HOUSE1_WINDOW", "WHITE_M", "CHI", "CHI", 13.0, 0.0, -15) } object { translation v -20.0 0.0 -25.0 fixedxyz v 0.0 1.5707963 0.0 #ifdef STATIC_OBJECTS static_rec on #endif town_house2(10.0, 5.2, 8.0, "HOUSE2_WALL", "HOUSE2_ROOF", "HOUSE2_DOOR", "HOUSE2_WINDOW") } object { translation v -45.0 0.0 -15.0 fixedxyz v 0.0 3.1415927 0.0 #ifdef STATIC_OBJECTS static_rec on #endif town_house3_gateway(15.0, 5.5, 15.0, "HOUSE2_WALL", "HOUSE1_ROOF", "HOUSE1_WINDOW", "HOUSE2_WINDOW", "WHITE_M", "mmedia", "MultiMedia", 11.5, 0.0, 48.0) } #if LOD < 5 object { translation v -35.0 0.0 -8.0 #ifdef STATIC_OBJECTS static_rec on #endif #if LOD == 0 complex_park_tree2(3.0, "TREES_TRUNK", "DECIDUOUS_GROUND") #else simple_park_tree2(3.0, "TREES_TRUNK", "DECIDUOUS_GROUND") #endif } object { translation v -35.0 0.0 -11.0 #ifdef STATIC_OBJECTS static_rec on #endif #if LOD == 0 complex_park_tree2(3.5, "TREES_TRUNK", "DECIDUOUS_GROUND") #else simple_park_tree2(3.5, "TREES_TRUNK", "DECIDUOUS_GROUND") #endif } object { translation v -35.0 0.0 -14.0 #ifdef STATIC_OBJECTS static_rec on #endif #if LOD == 0 complex_park_tree2(4.0, "TREES_TRUNK", "DECIDUOUS_GROUND") #else simple_park_tree2(4.0, "TREES_TRUNK", "DECIDUOUS_GROUND") #endif } #endif object { translation v -70.0 0.0 -11.0 fixedxyz v 0.0 3.1415927 0.0 #ifdef STATIC_OBJECTS static_rec on #endif /* town_house4(15.0, 8.0, 10.0, "HOUSE1_WALL", "HOUSE2_ROOF", "HOUSE2_ROOF", "HOUSE1_WINDOW") */ town_house4_gateway(15.0, 8.0, 10.0, "HOUSE1_WALL", "HOUSE2_ROOF", "HOUSE2_ROOF", "HOUSE1_WINDOW", "WHITE_M", "house", "House", -4.0, 0.0, 225.0) } /* "Island" */ object { #ifdef STATIC_OBJECTS static_rec on #endif translation v -55.0 0.0 23.0 fixedxyz v 0.0 3.1415927 0.0 town_house2_gateway(12.0, 5.2, 6.0, "ROCK", "WET_SWAMP", "HOUSE2_DOOR", "HOUSE2_WINDOW", "WHITE_M", "funworld", "Dead End", 0.0, 0.0, 0.0) #if LOD < 5 subs object { translation v -5.0 0.0 10.0 #if LOD == 0 complex_park_tree1(3.0, "HOUSES_GROUND", "BRUSHES_GROUND") #else simple_park_tree1(3.0, "HOUSES_GROUND", "BRUSHES_GROUND") #endif } subs object { translation v 0.0 0.0 10.0 #if LOD == 0 complex_park_tree1(3.2, "HOUSES_GROUND", "BRUSHES_GROUND") #else simple_park_tree1(3.2, "HOUSES_GROUND", "BRUSHES_GROUND") #endif } subs object { translation v 5.0 0.0 10.0 #if LOD == 0 complex_park_tree1(3.4, "HOUSES_GROUND", "BRUSHES_GROUND") #else simple_park_tree1(3.4, "HOUSES_GROUND", "BRUSHES_GROUND") #endif } #endif } object { translation v 38.0 0.0 44.0 #ifdef STATIC_OBJECTS static_rec on #endif office(8.0, 6.0, 8.0, "GREY_M", "CHECK_M", "BLACK_M") } object { translation v 15.0 0.0 43.0 fixedxyz v 0.0 2.3561945 0.0 #ifdef STATIC_OBJECTS static_rec on #endif town_house3(13.0, 5.0, 15.0, "HOUSE2_ROOF", "BLACK_M", "GREY_M", "HOUSE2_WINDOW") } object { translation v -10.0 0.0 45.0 #ifdef STATIC_OBJECTS static_rec on #endif town_house5("GREY_BROWN_M", "HOUSE1_WALL", "HOUSE2_ROOF") } object { translation v -35.0 0.0 65.0 #ifdef STATIC_OBJECTS static_rec on #endif town_house6("HOUSE1_WALL", "HOUSE1_ROOF") } object { translation v -35.0 0.0 87.0 #ifdef STATIC_OBJECTS static_rec on #endif town_house2(8.0, 5.0, 7.0, "TREES_TRUNK", "GREY_M", "HOUSE2_WINDOW", "GREY_BROWN_M") } object { translation v 3.0 0.0 17.0 fixedxyz v 0.0 1.5707963 0.0 #ifdef STATIC_OBJECTS static_rec on #endif town_house1(10.0, 5.5, 8.0, "HOUSE2_WALL", "BROWN_M", "HOUSE1_WINDOW", "HOUSE1_WINDOW") } /* Villa quarter */ object { translation v -85.0 0.0 40.0 fixedxyz v 0.0 -1.5707963 0.0 #ifdef STATIC_OBJECTS static_rec on #endif town_house1(9.0, 4.7, 8.0, "NOTHING", "DRY_SWAMP", "ROCK", "CHECK_GREY") #if LOD < 5 subs object { translation v -2.0 0.0 8.0 #if LOD == 0 complex_park_tree1(3.0, "TREES_TRUNK", "TREES_GROUND") #else simple_park_tree1(3.0, "TREES_TRUNK", "TREES_GROUND") #endif } subs object { translation v 2.0 0.0 8.0 #if LOD == 0 complex_park_tree1(3.0, "TREES_TRUNK", "TREES_GROUND") #else simple_park_tree1(3.0, "TREES_TRUNK", "TREES_GROUND") #endif } #endif } object { translation v -105.0 0.0 35.0 fixedxyz v 0.0 -1.5707963 0.0 #ifdef STATIC_OBJECTS static_rec on #endif town_house1(9.0, 4.7, 8.0, "NOTHING", "DRY_SWAMP", "ROCK", "CHECK_GREY") #if LOD < 5 subs object { translation v -2.0 0.0 8.0 #if LOD == 0 complex_park_tree1(3.0, "TREES_TRUNK", "TREES_GROUND") #else simple_park_tree1(3.0, "TREES_TRUNK", "TREES_GROUND") #endif } subs object { translation v 2.0 0.0 8.0 #if LOD == 0 complex_park_tree1(3.0, "TREES_TRUNK", "TREES_GROUND") #else simple_park_tree1(3.0, "TREES_TRUNK", "TREES_GROUND") #endif } #endif } object { translation v -125.0 0.0 40.0 fixedxyz v 0.0 -1.5707963 0.0 #ifdef STATIC_OBJECTS static_rec on #endif town_house1(9.0, 4.7, 8.0, "NOTHING", "DRY_SWAMP", "ROCK", "CHECK_GREY") #if LOD < 5 subs object { translation v -2.0 0.0 8.0 #if LOD == 0 complex_park_tree1(3.0, "TREES_TRUNK", "TREES_GROUND") #else simple_park_tree1(3.0, "TREES_TRUNK", "TREES_GROUND") #endif } subs object { translation v 2.0 0.0 8.0 #if LOD == 0 complex_park_tree1(3.0, "TREES_TRUNK", "TREES_GROUND") #else simple_park_tree1(3.0, "TREES_TRUNK", "TREES_GROUND") #endif } #endif } object { translation v -145.0 0.0 35.0 fixedxyz v 0.0 -1.5707963 0.0 #ifdef STATIC_OBJECTS static_rec on #endif town_house1(9.0, 4.7, 8.0, "NOTHING", "DRY_SWAMP", "ROCK", "CHECK_GREY") #if LOD < 5 subs object { translation v -2.0 0.0 8.0 #if LOD == 0 complex_park_tree1(3.0, "TREES_TRUNK", "TREES_GROUND") #else simple_park_tree1(3.0, "TREES_TRUNK", "TREES_GROUND") #endif } subs object { translation v 2.0 0.0 8.0 #if LOD == 0 complex_park_tree1(3.0, "TREES_TRUNK", "TREES_GROUND") #else simple_park_tree1(3.0, "TREES_TRUNK", "TREES_GROUND") #endif } #endif } object { translation v -165.0 0.0 40.0 fixedxyz v 0.0 -1.5707963 0.0 #ifdef STATIC_OBJECTS static_rec on #endif town_house1(9.0, 4.7, 8.0, "NOTHING", "DRY_SWAMP", "ROCK", "CHECK_GREY") #if LOD < 5 subs object { translation v -2.0 0.0 8.0 #if LOD == 0 complex_park_tree1(3.0, "TREES_TRUNK", "TREES_GROUND") #else simple_park_tree1(3.0, "TREES_TRUNK", "TREES_GROUND") #endif } subs object { translation v 2.0 0.0 8.0 #if LOD == 0 complex_park_tree1(3.0, "TREES_TRUNK", "TREES_GROUND") #else simple_park_tree1(3.0, "TREES_TRUNK", "TREES_GROUND") #endif } #endif } /* School */ object { translation v -95.0 0.0 85.0 fixedxyz v 0.0 -1.5707963 0.0 #ifdef STATIC_OBJECTS static_rec on #endif school(30.0, 4.0, 8.0, "DIVE School", "RED_NEON_M", "BLUE_NEON_M", "SEA_SURFACE", "HOUSE1_WINDOW") } #if LOD < 5 object { translation v -80.0 0.0 60.0 #ifdef STATIC_OBJECTS static_rec on #endif #if LOD == 0 complex_deciduous_tree(4.0, "TREES_TRUNK", "BRUSHES_GROUND") #else simple_deciduous_tree(4.0, "TREES_TRUNK", "BRUSHES_GROUND") #endif } object { translation v -80.0 0.0 70.0 #ifdef STATIC_OBJECTS static_rec on #endif #if LOD == 0 complex_deciduous_tree(4.0, "TREES_TRUNK", "BRUSHES_GROUND") #else simple_deciduous_tree(4.0, "TREES_TRUNK", "BRUSHES_GROUND") #endif } object { translation v -80.0 0.0 80.0 #ifdef STATIC_OBJECTS static_rec on #endif #if LOD == 0 complex_deciduous_tree(4.0, "TREES_TRUNK", "BRUSHES_GROUND") #else simple_deciduous_tree(4.0, "TREES_TRUNK", "BRUSHES_GROUND") #endif } object { translation v -80.0 0.0 90.0 #ifdef STATIC_OBJECTS static_rec on #endif #if LOD == 0 complex_deciduous_tree(4.0, "TREES_TRUNK", "BRUSHES_GROUND") #else simple_deciduous_tree(4.0, "TREES_TRUNK", "BRUSHES_GROUND") #endif } object { translation v -80.0 0.0 100.0 #ifdef STATIC_OBJECTS static_rec on #endif #if LOD == 0 complex_deciduous_tree(4.0, "TREES_TRUNK", "BRUSHES_GROUND") #else simple_deciduous_tree(4.0, "TREES_TRUNK", "BRUSHES_GROUND") #endif } object { translation v -90.0 0.0 60.0 #ifdef STATIC_OBJECTS static_rec on #endif #if LOD == 0 complex_deciduous_tree(4.0, "TREES_TRUNK", "BRUSHES_GROUND") #else simple_deciduous_tree(4.0, "TREES_TRUNK", "BRUSHES_GROUND") #endif } object { translation v -100.0 0.0 60.0 #ifdef STATIC_OBJECTS static_rec on #endif #if LOD == 0 complex_deciduous_tree(4.0, "TREES_TRUNK", "BRUSHES_GROUND") #else simple_deciduous_tree(4.0, "TREES_TRUNK", "BRUSHES_GROUND") #endif } #endif /* College */ object { translation v 20.0 0.0 -30.0 fixedxyz v 0.0 1.5707963 0.0 #ifdef STATIC_OBJECTS static_rec on #endif school(40.0, 4.0, 8.0, "DIVE College", "HOUSE1_WALL", "HOUSE1_ROOF", "HOUSE2_ROOF", "ROCK") } /* Stock houses... they are not using too many polygons!... */ object { translation v 40.0 0.0 -10.0 #ifdef STATIC_OBJECTS static_rec on #endif stock_house(8.0, 4.0, 5.0, "HOUSE2_ROOF", "HOUSE1_ROOF", "HOUSE2_DOOR") } object { translation v 48.0 0.0 -10.0 #ifdef STATIC_OBJECTS static_rec on #endif stock_house(8.0, 4.0, 5.0, "HOUSE2_ROOF", "HOUSE1_ROOF", "HOUSE2_DOOR") } object { translation v 56.0 0.0 -10.0 #ifdef STATIC_OBJECTS static_rec on #endif stock_house(8.0, 4.0, 5.0, "HOUSE2_ROOF", "HOUSE1_ROOF", "HOUSE2_DOOR") } object { translation v 64.0 0.0 -10.0 #ifdef STATIC_OBJECTS static_rec on #endif stock_house(8.0, 4.0, 5.0, "HOUSE2_ROOF", "HOUSE1_ROOF", "HOUSE2_DOOR") } object { translation v 72.0 0.0 -10.0 #ifdef STATIC_OBJECTS static_rec on #endif stock_house(8.0, 4.0, 5.0, "HOUSE2_ROOF", "HOUSE1_ROOF", "HOUSE2_DOOR") } /* And a few pine trees for beauty... */ #if LOD < 5 object { translation v 40.0 0.0 -4.0 #ifdef STATIC_OBJECTS static_rec on #endif #if LOD == 0 complex_pine_tree(4.0, "TREES_TRUNK", "TREES_GROUND") #else simple_pine_tree(4.0, "TREES_TRUNK", "TREES_GROUND") #endif } object { translation v 50.0 0.0 -4.0 #ifdef STATIC_OBJECTS static_rec on #endif #if LOD == 0 complex_pine_tree(4.0, "TREES_TRUNK", "TREES_GROUND") #else simple_pine_tree(4.0, "TREES_TRUNK", "TREES_GROUND") #endif } object { translation v 60.0 0.0 -4.0 #ifdef STATIC_OBJECTS static_rec on #endif #if LOD == 0 complex_pine_tree(4.0, "TREES_TRUNK", "TREES_GROUND") #else simple_pine_tree(4.0, "TREES_TRUNK", "TREES_GROUND") #endif } object { translation v 70.0 0.0 -4.0 #ifdef STATIC_OBJECTS static_rec on #endif #if LOD == 0 complex_pine_tree(4.0, "TREES_TRUNK", "TREES_GROUND") #else simple_pine_tree(4.0, "TREES_TRUNK", "TREES_GROUND") #endif } #endif /* Market Place */ /* Trees at the entry of the place */ #if LOD < 5 object { translation v 70.0 0.0 66.0 #ifdef STATIC_OBJECTS static_rec on #endif #if LOD == 0 complex_deciduous_tree(6.0, "TREES_TRUNK", "TREES_GROUND") #else simple_deciduous_tree(6.0, "TREES_TRUNK", "TREES_GROUND") #endif } object { translation v 90.0 0.0 66.0 #ifdef STATIC_OBJECTS static_rec on #endif #if LOD == 0 complex_deciduous_tree(6.0, "TREES_TRUNK", "TREES_GROUND") #else simple_deciduous_tree(6.0, "TREES_TRUNK", "TREES_GROUND") #endif } object { translation v 110.0 0.0 66.0 #ifdef STATIC_OBJECTS static_rec on #endif #if LOD == 0 complex_deciduous_tree(6.0, "TREES_TRUNK", "TREES_GROUND") #else simple_deciduous_tree(6.0, "TREES_TRUNK", "TREES_GROUND") #endif } object { translation v 130.0 0.0 66.0 #ifdef STATIC_OBJECTS static_rec on #endif #if LOD == 0 complex_deciduous_tree(6.0, "TREES_TRUNK", "TREES_GROUND") #else simple_deciduous_tree(6.0, "TREES_TRUNK", "TREES_GROUND") #endif } object { translation v 35.0 0.0 66.0 #ifdef STATIC_OBJECTS static_rec on #endif #if LOD == 0 complex_deciduous_tree(6.0, "TREES_TRUNK", "TREES_GROUND") #else simple_deciduous_tree(6.0, "TREES_TRUNK", "TREES_GROUND") #endif } object { translation v 15.0 0.0 66.0 #ifdef STATIC_OBJECTS static_rec on #endif #if LOD == 0 complex_deciduous_tree(6.0, "TREES_TRUNK", "TREES_GROUND") #else simple_deciduous_tree(6.0, "TREES_TRUNK", "TREES_GROUND") #endif } object { translation v -5.0 0.0 66.0 #ifdef STATIC_OBJECTS static_rec on #endif #if LOD == 0 complex_deciduous_tree(6.0, "TREES_TRUNK", "TREES_GROUND") #else simple_deciduous_tree(6.0, "TREES_TRUNK", "TREES_GROUND") #endif } #endif /* Lamps at the entry of the market place */ #if LOD < 3 object { translation v 70.5 0.0 70.5 #ifdef STATIC_OBJECTS static_rec on #endif street_lamp(2.5, "HOUSE1_ROOF", "HOUSE1_WALL") } object { translation v 70.5 0.0 61.5 #ifdef STATIC_OBJECTS static_rec on #endif street_lamp(2.5, "HOUSE1_ROOF", "HOUSE1_WALL") } object { translation v 60.5 0.0 70.5 #ifdef STATIC_OBJECTS static_rec on #endif street_lamp(2.5, "HOUSE1_ROOF", "HOUSE1_WALL") } object { translation v 60.5 0.0 61.5 #ifdef STATIC_OBJECTS static_rec on #endif street_lamp(2.5, "HOUSE1_ROOF", "HOUSE1_WALL") } object { translation v 44.5 0.0 70.5 #ifdef STATIC_OBJECTS static_rec on #endif street_lamp(2.5, "HOUSE1_ROOF", "HOUSE1_WALL") } object { translation v 44.5 0.0 61.5 #ifdef STATIC_OBJECTS static_rec on #endif street_lamp(2.5, "HOUSE1_ROOF", "HOUSE1_WALL") } object { translation v 34.5 0.0 70.5 #ifdef STATIC_OBJECTS static_rec on #endif street_lamp(2.5, "HOUSE1_ROOF", "HOUSE1_WALL") } object { translation v 34.5 0.0 61.5 #ifdef STATIC_OBJECTS static_rec on #endif street_lamp(2.5, "HOUSE1_ROOF", "HOUSE1_WALL") } #endif /* Church */ object { translation v 52.5 0.0 160.0 fixedxyz v 0.0 3.1415927 0.0 #ifdef STATIC_OBJECTS static_rec on #endif church("BROWN_M", "GREY_BROWN_M") } /* Benches around the church */ #if LOD < 3 object { translation v 66.0 0.0 113.0 #ifdef STATIC_OBJECTS static_rec on #endif bench(2.0, 0.7, 0.5, "BROWN_M", "BOTTLE_GREEN_M") } object { translation v 66.0 0.0 114.0 fixedxyz v 0.0 3.1415927 0.0 #ifdef STATIC_OBJECTS static_rec on #endif bench(2.0, 0.7, 0.5, "BROWN_M", "BOTTLE_GREEN_M") } object { translation v 66.0 0.0 127.0 #ifdef STATIC_OBJECTS static_rec on #endif bench(2.0, 0.7, 0.5, "BROWN_M", "BOTTLE_GREEN_M") } object { translation v 66.0 0.0 128.0 fixedxyz v 0.0 3.1415927 0.0 #ifdef STATIC_OBJECTS static_rec on #endif bench(2.0, 0.7, 0.5, "BROWN_M", "BOTTLE_GREEN_M") } object { translation v 52.5 0.0 113.0 #ifdef STATIC_OBJECTS static_rec on #endif bench(2.0, 0.7, 0.5, "BROWN_M", "BOTTLE_GREEN_M") } object { translation v 52.5 0.0 114.0 fixedxyz v 0.0 3.1415927 0.0 #ifdef STATIC_OBJECTS static_rec on #endif bench(2.0, 0.7, 0.5, "BROWN_M", "BOTTLE_GREEN_M") } object { translation v 52.5 0.0 127.0 #ifdef STATIC_OBJECTS static_rec on #endif bench(2.0, 0.7, 0.5, "BROWN_M", "BOTTLE_GREEN_M") } object { translation v 52.5 0.0 128.0 fixedxyz v 0.0 3.1415927 0.0 #ifdef STATIC_OBJECTS static_rec on #endif bench(2.0, 0.7, 0.5, "BROWN_M", "BOTTLE_GREEN_M") } object { translation v 39.0 0.0 113.0 #ifdef STATIC_OBJECTS static_rec on #endif bench(2.0, 0.7, 0.5, "BROWN_M", "BOTTLE_GREEN_M") } object { translation v 39.0 0.0 114.0 fixedxyz v 0.0 3.1415927 0.0 #ifdef STATIC_OBJECTS static_rec on #endif bench(2.0, 0.7, 0.5, "BROWN_M", "BOTTLE_GREEN_M") } object { translation v 39.0 0.0 127.0 #ifdef STATIC_OBJECTS static_rec on #endif bench(2.0, 0.7, 0.5, "BROWN_M", "BOTTLE_GREEN_M") } object { translation v 39.0 0.0 128.0 fixedxyz v 0.0 3.1415927 0.0 #ifdef STATIC_OBJECTS static_rec on #endif bench(2.0, 0.7, 0.5, "BROWN_M", "BOTTLE_GREEN_M") } #endif /* Trees around the church */ #if LOD < 5 object { translation v 25.0 0.0 160.0 #ifdef STATIC_OBJECTS static_rec on #endif #if LOD == 0 complex_pine_tree(6.0, "BROWN_M", "BOTTLE_GREEN_M") #else simple_pine_tree(6.0, "BROWN_M", "BOTTLE_GREEN_M") #endif } object { translation v 25.0 0.0 150.0 #ifdef STATIC_OBJECTS static_rec on #endif #if LOD == 0 complex_pine_tree(6.0, "BROWN_M", "BOTTLE_GREEN_M") #else simple_pine_tree(6.0, "BROWN_M", "BOTTLE_GREEN_M") #endif } object { translation v 25.0 0.0 140.0 #ifdef STATIC_OBJECTS static_rec on #endif #if LOD == 0 complex_pine_tree(6.0, "BROWN_M", "BOTTLE_GREEN_M") #else simple_pine_tree(6.0, "BROWN_M", "BOTTLE_GREEN_M") #endif } object { translation v 25.0 0.0 130.0 #ifdef STATIC_OBJECTS static_rec on #endif #if LOD == 0 complex_pine_tree(6.0, "BROWN_M", "BOTTLE_GREEN_M") #else simple_pine_tree(6.0, "BROWN_M", "BOTTLE_GREEN_M") #endif } object { translation v 80.0 0.0 160.0 #ifdef STATIC_OBJECTS static_rec on #endif #if LOD == 0 complex_pine_tree(6.0, "BROWN_M", "BOTTLE_GREEN_M") #else simple_pine_tree(6.0, "BROWN_M", "BOTTLE_GREEN_M") #endif } object { translation v 80.0 0.0 150.0 #ifdef STATIC_OBJECTS static_rec on #endif #if LOD == 0 complex_pine_tree(6.0, "BROWN_M", "BOTTLE_GREEN_M") #else simple_pine_tree(6.0, "BROWN_M", "BOTTLE_GREEN_M") #endif } object { translation v 80.0 0.0 140.0 #ifdef STATIC_OBJECTS static_rec on #endif #if LOD == 0 complex_pine_tree(6.0, "BROWN_M", "BOTTLE_GREEN_M") #else simple_pine_tree(6.0, "BROWN_M", "BOTTLE_GREEN_M") #endif } object { translation v 80.0 0.0 130.0 #ifdef STATIC_OBJECTS static_rec on #endif #if LOD == 0 complex_pine_tree(6.0, "BROWN_M", "BOTTLE_GREEN_M") #else simple_pine_tree(6.0, "BROWN_M", "BOTTLE_GREEN_M") #endif } #endif /* Outside the market place/church */ object { translation v 75.0 0.0 30.0 #ifdef STATIC_OBJECTS static_rec on #endif town_house7("GREY_BROWN_M", "BROWN_M", "GREY_M") } /* Cameras */ #define camera(NAME) \ name NAME \ prop "camera" TYPE_FLOAT 50.0 GLOBAL_PROP \ visibility off \ material "RED_NEON_M" \ view { \ RBOX v -0.2 -0.2 -0.2 v 0.2 0.2 1.0 \ } object { translation v 0.0 10.0 -120.0 fixedxyz v 0.2 0 0 camera("Entry_View") } object { translation v 130 10.0 3 fixedxyz v 0.1 -1.5707963 0 camera("Main_Road_View_1") } object { translation v -130 10.0 3 fixedxyz v 0.1 1.5707963 0 camera("Main_Road_View_2") } object { translation v -100 20 200 fixedxyz v 0.15 2.2 0 camera("Church_View") } object { translation v -10 3.0 -29.0 fixedxyz v 0.0 0.4 0 camera("City_Center") } object { translation v -170 7 85 fixedxyz v 0.1 2.1 0 camera("Housing_Lots") } /* Watertower */ #if LOD < 4 watertower(180.0, 0.0, 110.0, 0.0) #endif /* Gateway to Nature */ object { material "GATEWAY_M" translation v -200.0 0.0 3.0 visibility off gateway "nature" v -1150.0 0.0 350.0 view 0 { N_POLY 4 v 0.0 0.0 -20.0 v 0.0 20.0 -20.0 v 0.0 20.0 20.0 v 0.0 0.0 20.0 } } object { translation v -190.0 0.0 -1.0 fixedxyz v 0.0 -1.5707963 0.0 #ifdef STATIC_OBJECTS static_rec on #endif direction_road_sign(1.0, 1.0, 0.1, "RED_NEON_M", "WHEAT_M", "WHITE_M", "To Nature") } /* Gateway to the solarsystem */ object { material "GATEWAY_M" visibility off gateway "solarsystem" v 0.0 100.0 -300.0 view 0 { N_POLY 4 v -300 SKY_LEVEL -300 v 300 SKY_LEVEL -300 v 300 SKY_LEVEL 300 v -300 SKY_LEVEL 300 } } /* Gateway to vworld */ object { material "GATEWAY_M" translation v 0.0 0.0 -160.0 visibility off gateway "http://www.sics.se/dive/sics.vr" v 60.0 0.0 22.0 view 0 { N_POLY 4 v -30.0 0.0 0.0 v 30.0 0.0 0.0 v 30.0 20.0 0.0 v -30.0 20.0 0.0 } } object { translation v 5.0 0.0 -145.0 fixedxyz v 0.0 3.1415927 0.0 #ifdef STATIC_OBJECTS static_rec on #endif direction_road_sign(1.0, 1.0, 0.1, "RED_NEON_M", "WHEAT_M", "WHITE_M", "To VWorld") } /* Gateway to Detailed Town */ #if LOD > 2 object { material "GATEWAY_M" translation v 250.0 0.0 97.5 visibility off gateway "detailed_dive_town" v -220.0 0.0 52.0 view 0 { N_POLY 4 v 0.0 0.0 -20.0 v 0.0 0.0 20.0 v 0.0 20.0 20.0 v 0.0 20.0 -20.0 } } object { translation v 230.0 0.0 101.25 fixedxyz v 0.0 1.5707963 0.0 #ifdef STATIC_OBJECTS static_rec on #endif direction_road_sign(1.5, 1.0, 0.1, "RED_NEON_M", "WHEAT_M", "WHITE_M", "To Detailed Town") } #endif /* Spheres around the car path */ #define path_delimiter(x, y, z) \ object { \ material "RED_NEON_M" \ wireframe on \ visibility off \ collision on \ translation \ v x y z \ view 0 { \ SPHERE 2.0 2.0 2.0 \ } \ } #define CAR_PATH_LEVEL -10.0 path_delimiter(55.0, CAR_PATH_LEVEL, 4.5) path_delimiter(51.5, CAR_PATH_LEVEL, 63.0) path_delimiter(15.0, CAR_PATH_LEVEL, 59.5) path_delimiter(150.0, CAR_PATH_LEVEL, 60.5) path_delimiter(146.5, CAR_PATH_LEVEL, 200.0) path_delimiter(-20.0, CAR_PATH_LEVEL, 196.5) path_delimiter(-16.5, CAR_PATH_LEVEL, 104.0) path_delimiter(-75.0, CAR_PATH_LEVEL, 107.5) path_delimiter(-71.5, CAR_PATH_LEVEL, -2.0) path_delimiter(-95.0, CAR_PATH_LEVEL, 1.5) path_delimiter(-91.5, CAR_PATH_LEVEL, -150.0) path_delimiter(0.5, CAR_PATH_LEVEL, -146.5) path_delimiter(-3.0, CAR_PATH_LEVEL, 8.0) #define straight_on(STATE) \ arc { STATE -> STATE signal TIMER_SIGNAL type MOVE_FREQ \ translation LOCAL_C MOVE_DIST 0.0 0.0 \ } #define turn_right(START_STATE, STOP_STATE) \ arc { START_STATE -> (START_STATE+1) signal COLLISION_SIGNAL \ type DIVE_COLLISION \ rotation LOCAL_C 0.0 -0.39269908 0.0 \ } \ arc { (START_STATE+1) -> (START_STATE+2) signal TIMER_SIGNAL \ type MOVE_FREQ \ rotation LOCAL_C 0.0 -0.39269908 0.0 \ } \ arc { (START_STATE+2) -> (START_STATE+3) signal TIMER_SIGNAL \ type MOVE_FREQ \ rotation LOCAL_C 0.0 -0.39269908 0.0 \ } \ arc { (START_STATE+3) -> (START_STATE+4) signal TIMER_SIGNAL \ type MOVE_FREQ \ rotation LOCAL_C 0.0 -0.39269908 0.0 \ } \ arc { (START_STATE+4) -> STOP_STATE signal TIMER_SIGNAL type MOVE_FREQ \ translation LOCAL_C MOVE_DIST 0.0 0.0 \ } #define turn_left(START_STATE, STOP_STATE) \ arc { START_STATE -> (START_STATE+1) signal COLLISION_SIGNAL \ type DIVE_COLLISION \ rotation LOCAL_C 0.0 0.39269908 0.0 \ } \ arc { (START_STATE+1) -> (START_STATE+2) signal TIMER_SIGNAL \ type MOVE_FREQ \ rotation LOCAL_C 0.0 0.39269908 0.0 \ } \ arc { (START_STATE+2) -> (START_STATE+3) signal TIMER_SIGNAL \ type MOVE_FREQ \ rotation LOCAL_C 0.0 0.39269908 0.0 \ } \ arc { (START_STATE+3) -> (START_STATE+4) signal TIMER_SIGNAL \ type MOVE_FREQ \ rotation LOCAL_C 0.0 0.39269908 0.0 \ } \ arc { (START_STATE+4) -> STOP_STATE signal TIMER_SIGNAL type MOVE_FREQ \ translation LOCAL_C MOVE_DIST 0.0 0.0 \ } /* Car */ object { material "RED_NEON_M" wireframe on collision on visibility off translation v 0.0 CAR_PATH_LEVEL 4.5 view 0 { SPHERE 2.0 2.0 2.0 } #if 0 behaviour { straight_on(0) turn_right(0,10) straight_on(10) turn_left(10,20) straight_on(20) turn_right(20,30) straight_on(30) turn_right(30,40) straight_on(40) turn_right(40,50) straight_on(50) turn_left(50,60) straight_on(60) turn_right(60,70) straight_on(70) turn_left(70,80) straight_on(80) turn_right(80,90) straight_on(90) turn_right(90,100) straight_on(100) turn_right(100,110) straight_on(110) turn_left(110,0) } #endif subs object { translation v 0.0 (ROAD_LEVEL-(CAR_PATH_LEVEL)) 0.0 fixedxyz v 0 -1.5707963 0.0 /* The following suppose jeep.vr is composed of one and only one object */ subs #include "jeep.vr" } } /* Spheres around the bus path */ #define BUS_PATH_LEVEL -20.0 path_delimiter(300.0, BUS_PATH_LEVEL, 4.5) path_delimiter(-300.0, BUS_PATH_LEVEL, 1.5) /* Car */ object { material "RED_NEON_M" wireframe on collision on visibility off translation v -290.0 BUS_PATH_LEVEL 4.5 view 0 { SPHERE 2.0 2.0 2.0 } #if 0 behaviour { arc { 0 -> 0 signal TIMER_SIGNAL type MOVE_FREQ translation LOCAL_C MOVE_DIST 0.0 0.0 } arc { 0 -> 1 signal COLLISION_SIGNAL type DIVE_COLLISION rotation LOCAL_C 0.0 1.5707963 0.0 translation LOCAL_C 3.0 0.0 0.0 rotation LOCAL_C 0.0 1.5707963 0.0 } arc { 1 -> 2 signal RANDOM_SIGNAL type 50 visibility_rec off } arc { 1 -> 2 signal RANDOM_SIGNAL type 50 visibility_rec on } arc { 2 -> 3 signal TIMER_SIGNAL type MOVE_FREQ translation LOCAL_C MOVE_DIST 0.0 0.0 } arc { 3 -> 3 signal TIMER_SIGNAL type MOVE_FREQ translation LOCAL_C MOVE_DIST 0.0 0.0 } arc { 3 -> 4 signal COLLISION_SIGNAL type DIVE_COLLISION rotation LOCAL_C 0.0 1.5707963 0.0 translation LOCAL_C 3.0 0.0 0.0 rotation LOCAL_C 0.0 1.5707963 0.0 } arc { 4 -> 5 signal RANDOM_SIGNAL type 50 visibility_rec off } arc { 4 -> 5 signal RANDOM_SIGNAL type 50 visibility_rec on } arc { 5 -> 0 signal TIMER_SIGNAL type MOVE_FREQ translation LOCAL_C MOVE_DIST 0.0 0.0 } } #endif subs object { translation v 0.0 (ROAD_LEVEL-(BUS_PATH_LEVEL)) 0.0 fixedxyz v 0 -1.5707963 0.0 /* The following suppose jeep.vr is composed of one and only one object */ subs #include "jeep.vr" } }