max_y 1980;

surfaces "cor_section_surf"
	4  3 0 1 2  /* inside wall */
	4  4 5 6 7  /* outside wall */
	4  2 3 7 6  /* ceiling */
	4  0 1 5 4; /* floor */


light 0 -18000 0 0.3;


ambient 0.4;

surfaces "topless_cubesurf"
	4  2 3 0 1
	4  1 0 4 5
	4  5 4 7 6
	4  6 7 3 2
	4  0 3 7 4;

object "light_obj" "cubepoints" "topless_cubesurf"
	colour "white" 1.0
	scale 0.25 0.2 1.0;

object "portal1"
    inherit "z_portal"
    maxdist 40000
    portal "room" -22000 2000 -14000
    centre 28000 500 -6000;

object "portal2"
    inherit "portal1"
    portal "world" 0 0 30000
    centre -26000 0 -5000;

points "cor_section0_points"
	-1729 2000 -3441
	-2708 2000 2739
	-2708 -2000 2739
	-1729 -2000 -3441
	2271 2000 -3441
	1096 2000 3975
	1096 -2000 3975
	2271 -2000 -3441;

object "cor_section0" "cor_section0_points" "cor_section_surf"
	NO_MATRIX_MULT
	INSIDE_OUT
	maxdist 40000
	colour "blue" 1
	centre 21729 0 3441;


object "light_0"
	inherit "light_obj"
	maxdist 40000
	rotate_y -9
	centre 21729 -1900 3441;


light 21729 -1760 3441 1 2500;

points "cor_section1_points"
	-581 2000 -3807
	-3422 2000 1768
	-3422 -2000 1768
	-581 -2000 -3807
	3223 2000 -2571
	-186 2000 4119
	-186 -2000 4119
	3223 -2000 -2571;

object "cor_section1" "cor_section1_points" "cor_section_surf"
	NO_MATRIX_MULT
	INSIDE_OUT
	maxdist 40000
	colour "blue" 1
	centre 19602 0 9987;


object "light_1"
	inherit "light_obj"
	maxdist 40000
	rotate_y -27
	centre 19602 -1900 9987;


light 19602 -1760 9987 1 2500;

points "cor_section2_points"
	624 2000 -3801
	-3801 2000 624
	-3801 -2000 624
	624 -2000 -3801
	3860 2000 -1450
	-1450 2000 3860
	-1450 -2000 3860
	3860 -2000 -1450;

object "cor_section2" "cor_section2_points" "cor_section_surf"
	NO_MATRIX_MULT
	INSIDE_OUT
	maxdist 40000
	colour "blue" 1
	centre 15556 0 15556;


object "light_2"
	inherit "light_obj"
	maxdist 40000
	rotate_y -45
	centre 15556 -1900 15556;


light 15556 -1760 15556 1 2500;

points "cor_section3_points"
	1768 2000 -3422
	-3807 2000 -581
	-3807 -2000 -581
	1768 -2000 -3422
	4119 2000 -186
	-2571 2000 3223
	-2571 -2000 3223
	4119 -2000 -186;

object "cor_section3" "cor_section3_points" "cor_section_surf"
	NO_MATRIX_MULT
	INSIDE_OUT
	maxdist 40000
	colour "blue" 1
	centre 9987 0 19602;


object "light_3"
	inherit "light_obj"
	maxdist 40000
	rotate_y -63
	centre 9987 -1900 19602;


light 9987 -1760 19602 1 2500;

points "cor_section4_points"
	2739 2000 -2708
	-3441 2000 -1729
	-3441 -2000 -1729
	2739 -2000 -2708
	3975 2000 1096
	-3441 2000 2271
	-3441 -2000 2271
	3975 -2000 1096;

object "cor_section4" "cor_section4_points" "cor_section_surf"
	NO_MATRIX_MULT
	INSIDE_OUT
	maxdist 40000
	colour "blue" 1
	centre 3441 0 21729;


object "light_4"
	inherit "light_obj"
	maxdist 40000
	rotate_y -81
	centre 3441 -1900 21729;


light 3441 -1760 21729 1 2500;

points "cor_section5_points"
	3441 2000 -1729
	-2739 2000 -2708
	-2739 -2000 -2708
	3441 -2000 -1729
	3441 2000 2271
	-3975 2000 1096
	-3975 -2000 1096
	3441 -2000 2271;

object "cor_section5" "cor_section5_points" "cor_section_surf"
	NO_MATRIX_MULT
	INSIDE_OUT
	maxdist 40000
	colour "blue" 1
	centre -3441 0 21729;


object "light_5"
	inherit "light_obj"
	maxdist 40000
	rotate_y -99
	centre -3441 -1900 21729;


light -3441 -1760 21729 1 2500;

points "cor_section6_points"
	3807 2000 -581
	-1768 2000 -3422
	-1768 -2000 -3422
	3807 -2000 -581
	2571 2000 3223
	-4119 2000 -186
	-4119 -2000 -186
	2571 -2000 3223;

object "cor_section6" "cor_section6_points" "cor_section_surf"
	NO_MATRIX_MULT
	INSIDE_OUT
	maxdist 40000
	colour "blue" 1
	centre -9987 0 19602;


object "light_6"
	inherit "light_obj"
	maxdist 40000
	rotate_y -117
	centre -9987 -1900 19602;


light -9987 -1760 19602 1 2500;

points "cor_section7_points"
	3801 2000 624
	-624 2000 -3801
	-624 -2000 -3801
	3801 -2000 624
	1450 2000 3860
	-3860 2000 -1450
	-3860 -2000 -1450
	1450 -2000 3860;

object "cor_section7" "cor_section7_points" "cor_section_surf"
	NO_MATRIX_MULT
	INSIDE_OUT
	maxdist 40000
	colour "blue" 1
	centre -15556 0 15556;


object "light_7"
	inherit "light_obj"
	maxdist 40000
	rotate_y -135
	centre -15556 -1900 15556;


light -15556 -1760 15556 1 2500;

points "cor_section8_points"
	3422 2000 1768
	581 2000 -3807
	581 -2000 -3807
	3422 -2000 1768
	186 2000 4119
	-3223 2000 -2571
	-3223 -2000 -2571
	186 -2000 4119;

object "cor_section8" "cor_section8_points" "cor_section_surf"
	NO_MATRIX_MULT
	INSIDE_OUT
	maxdist 40000
	colour "blue" 1
	centre -19602 0 9987;


object "light_8"
	inherit "light_obj"
	maxdist 40000
	rotate_y -153
	centre -19602 -1900 9987;


light -19602 -1760 9987 1 2500;

points "cor_section9_points"
	2708 2000 2739
	1729 2000 -3441
	1729 -2000 -3441
	2708 -2000 2739
	-1096 2000 3975
	-2271 2000 -3441
	-2271 -2000 -3441
	-1096 -2000 3975;

object "cor_section9" "cor_section9_points" "cor_section_surf"
	NO_MATRIX_MULT
	INSIDE_OUT
	maxdist 40000
	colour "blue" 1
	centre -21729 0 3441;


object "light_9"
	inherit "light_obj"
	maxdist 40000
	rotate_y -171
	centre -21729 -1900 3441;


light -21729 -1760 3441 1 2500;


points "room1points"
    10000 -2000 -10000   10000 -2000 10000   -10000 -2000 10000
    -10000 -2000 -10000
    10000 2000 -10000   10000 2000 10000   -10000 2000 10000
    -10000 2000 -10000
    2000 -2000 10000   -2000 -2000 10000   -2000 2000 10000
    2000 2000 10000;

/* Room open at right hand side */
surfaces "room1surf"
    4  0 1 2 3    /* roof */
    4  4 5 6 7    /* floor */
    4  0 1 5 4    /* left wall */
    4  2 3 7 6    /* right wall */
    4  0 3 7 4    /* back wall */
    4  1 5 11 8   /* front wall (left side) */
    4  2 6 10 9;  /* front wall (right side) */

object "room1" "room1points" "room1surf"
    INSIDE_OUT
    NO_MATRIX_MULT
    colour "blue" 1.0
    maxdist 35000
    centre 22000 0 -10000;

light 20000 -1900 -15000 0.6;  /* light for room1 */

object "room2"
    inherit "room1"
    centre -22000 0 -10000;

object "box" "cubepoints" "bottomless_cubesurf"
    colour "brown" 1.0
    scale 2 2 2
    maxdist 40000
    centre -15000 1000 -5000;

object "box2"
    inherit "box"
    centre -25000 1000 -11000;

object "box3"
    inherit "box"
    centre -15000 1000 -13000;

object "box4"
    inherit "box3"
    rotate_y 25.0
    translate -3000 0 2000;

object "box5" "cubepoints" "cubesurf"
    inherit "box3"
    rotate_y -45.0
    translate -1500 -2010 1000;

object "box6"
    inherit "box"
    scale 0.5 0.5 0.5
    centre -18000 1500 -9000;


light -20000 -1900 -15000 0.6;  /* light for room2 */

points "wallpoints"
    -2000 -1000 0   2000 -1000 0   2000 1000 0   -2000 1000 0;

object "wall" "wallpoints" "squaresurf"
    colour "brown" 0.7
    ALWAYS_VISIBLE
    NO_MATRIX_MULT
    centre 18000 -500 -8000;

points "ramppoints"
    -500 -1500 -4000   500 -1500 -4000   500 0 0
    -500 0 0;

object "ramp" "ramppoints" "squaresurf"
    colour "brown" 0.75
    centre 22000 2000 -4000
    NO_MATRIX_MULT
    ALWAYS_VISIBLE;

points "platformpoints"
    -6000 0 -4000   6000 0 -4000   6000 0 4000   -6000 0 4000;

object "platform" "platformpoints" "squaresurf"
    ALWAYS_VISIBLE
    NO_MATRIX_MULT
    colour "brown" 0.75
    centre 18000 500 -12000;


object "The world"
	child "room1"
	child "portal1"
	child "portal2"
	child "room2"
	child "box"
	child "box2"
	child "box3"
	child "box4"
	child "box5"
	child "box6"
	child "ramp"
	child "wall"
	child "platform"
	child "cor_section0"
	child "light_0"
	child "cor_section1"
	child "light_1"
	child "cor_section2"
	child "light_2"
	child "cor_section3"
	child "light_3"
	child "cor_section4"
	child "light_4"
	child "cor_section5"
	child "light_5"
	child "cor_section6"
	child "light_6"
	child "cor_section7"
	child "light_7"
	child "cor_section8"
	child "light_8"
	child "cor_section9"
	child "light_9"
	NO_MATRIX_MULT;

world "The world" enclosed;
