01 function bounds_box( bounds )
02 dim mx: mx = bounds( BOUNDS_MIN )( VERTEX_X )
03 dim my: my = bounds( BOUNDS_MIN )( VERTEX_Y )
04 dim mz: mz = bounds( BOUNDS_MIN )( VERTEX_Z )
05
06 dim nx: nx = bounds( BOUNDS_MAX )( VERTEX_X )
07 dim ny: ny = bounds( BOUNDS_MAX )( VERTEX_Y )
08 dim nz: nz = bounds( BOUNDS_MAX )( VERTEX_Z )
09
10 dim vertices: vertices = array( _
11 vertex_new( mx, my, mz ), _
12 vertex_new( nx, my, mz ), _
13 vertex_new( nx, ny, mz ), _
14 vertex_new( mx, ny, mz ), _
15 vertex_new( mx, my, nz ), _
16 vertex_new( nx, my, nz ), _
17 vertex_new( nx, ny, nz ), _
18 vertex_new( mx, ny, nz ) _
19 )
20
21 dim indices: indices = array( _
22 array( 0, 3, 2, 1 ), _
23 array( 4, 5, 6, 7 ), _
24 array( 0, 1, 5, 4 ), _
25 array( 3, 7, 6, 2 ), _
26 array( 0, 4, 7, 3 ), _
27 array( 1, 2, 6, 5 ) _
28 )
29
30 bounds_box = array( vertices, indices )
31 end function