7 bool shape::cover( double x, double y ) { return false; }
9 void draw_shape_coverage( shape *s, int div_x, int div_y ) {
12 for( i = 0; i < 1.0; i += 1.0 / ((float)div_y) ) {
13 for( j = 0; j < 1.0; j += 1.0 / ((float)div_x) ) {
14 if( s->cover( j,i ) ) putchar( 'x' ); else putchar( ' ' );
20 void draw_depth_map( volume *v, int div_x, int div_y ) {
22 char depth_map_chars[] = "#*+o;:,. ";
23 double lowbound, highbound;
25 bool bounds_set = false;
27 for( i = 0; i < 1.0; i += 1.0 / ((float)div_y) ) {
28 for( j = 0; j < 1.0; j += 1.0 / ((float)div_x) ) {
29 current = v->depth( j,i );
31 lowbound = current; highbound = current; bounds_set = true;
33 if( current < lowbound ) lowbound = current;
34 if( current > highbound ) highbound = current;
38 for( i = 0; i < 1.0; i += 1.0 / ((float)div_y) ) {
39 for( j = 0; j < 1.0; j += 1.0 / ((float)div_x) ) {
40 current = ((v->depth( j,i ) - lowbound) /
41 (highbound - lowbound)) * 8;
42 putchar(depth_map_chars[(int)current]);
48 double volume::depth( double x, double y ) { return 0.0; }