illuminance grid revisited

I've been away from my dual G5 machine, so could not work on the nfs issue (which I have to get back to shortly), but in the meantime, I have noticed something in a past discussion that I find puzzling. It's regarding getting illuminance values across a grid using rtrace.

> > a better example for a grid
> > of 15 by 30 points spread in a 10x20 room and 2.5 feet
>off
> > the floor with a half foot margin on each side would be:
> >
> > % cnt 15 30 | rcalc -e '$1=(10-.5)/(15-1)*$1;$2=(20-.5)/(30-1)*$2;$3=2.5' \
> > -e '$4=0;$5=0;$6=1' | rtrace -I -h [options] octree \
> > > rcalc -e '$1=179*(.265*$1+.670*$2+.065*$3)' >
>output.dat
>

I had been using modification of the above to generate the grid and get illuminance values. But recently, I just tried this:
> > % cnt 6 12 | rcalc -e '$1=(162-13.5)/(6-1)*$1;$2=(324-13.5)/(12-1)*$2;$3=36;$4=0;$5=0;$6=1' > output.out

This was for a scene modeled in inches, and the room dimensions are 13'-5" x 27'. I wanted to divide the room into 27" squares and get illuminance readings at their center. The output I got was

0 0 36 0 0 1
0 28.2272727 36 0 0 1
0 56.4545455 36 0 0 1
0 84.6818182 36 0 0 1
0 112.909091 36 0 0 1
0 141.136364 36 0 0 1
0 169.363636 36 0 0 1
0 197.590909 36 0 0 1
0 225.818182 36 0 0 1
0 254.045455 36 0 0 1
0 282.272727 36 0 0 1
0 310.5 36 0 0 1
29.7 0 36 0 0 1
29.7 28.2272727 36 0 0 1
29.7 56.4545455 36 0 0 1
29.7 84.6818182 36 0 0 1
29.7 112.909091 36 0 0 1
29.7 141.136364 36 0 0 1
29.7 169.363636 36 0 0 1
29.7 197.590909 36 0 0 1
29.7 225.818182 36 0 0 1
29.7 254.045455 36 0 0 1
29.7 282.272727 36 0 0 1
29.7 310.5 36 0 0 1
59.4 0 36 0 0 1
59.4 28.2272727 36 0 0 1
59.4 56.4545455 36 0 0 1
59.4 84.6818182 36 0 0 1
59.4 112.909091 36 0 0 1
59.4 141.136364 36 0 0 1
59.4 169.363636 36 0 0 1
59.4 197.590909 36 0 0 1
59.4 225.818182 36 0 0 1
59.4 254.045455 36 0 0 1
59.4 282.272727 36 0 0 1
59.4 310.5 36 0 0 1
89.1 0 36 0 0 1
89.1 28.2272727 36 0 0 1
89.1 56.4545455 36 0 0 1
89.1 84.6818182 36 0 0 1
89.1 112.909091 36 0 0 1
89.1 141.136364 36 0 0 1
89.1 169.363636 36 0 0 1
89.1 197.590909 36 0 0 1
89.1 225.818182 36 0 0 1
89.1 254.045455 36 0 0 1
89.1 282.272727 36 0 0 1
89.1 310.5 36 0 0 1
118.8 0 36 0 0 1
118.8 28.2272727 36 0 0 1
118.8 56.4545455 36 0 0 1
118.8 84.6818182 36 0 0 1
118.8 112.909091 36 0 0 1
118.8 141.136364 36 0 0 1
118.8 169.363636 36 0 0 1
118.8 197.590909 36 0 0 1
118.8 225.818182 36 0 0 1
118.8 254.045455 36 0 0 1
118.8 282.272727 36 0 0 1
118.8 310.5 36 0 0 1
148.5 0 36 0 0 1
148.5 28.2272727 36 0 0 1
148.5 56.4545455 36 0 0 1
148.5 84.6818182 36 0 0 1
148.5 112.909091 36 0 0 1
148.5 141.136364 36 0 0 1
148.5 169.363636 36 0 0 1
148.5 197.590909 36 0 0 1
148.5 225.818182 36 0 0 1
148.5 254.045455 36 0 0 1
148.5 282.272727 36 0 0 1
148.5 310.5 36 0 0 1

What puzzled me was that this output takes some of the reading at points that are in the wall (x values of 0, and y values of 0), and that the grid is actually shifted. If all the values are taken as an average, then I doubt this shift has a huge impact. However, if you need to take readings at precise points distributed across the room, it seems to me that this grid would be off.

So, I fiddled with what rudimentary mathematics I can handle, tried this instead

> > % cnt 6 12 | rcalc -e '$1=(162/6)*$1+13.5;$2=(324/12)*$2+13.5;$3=36;$4=0;$5=0;$6=1' > output.out

13.5 13.5 36 0 0 1
13.5 40.5 36 0 0 1
13.5 67.5 36 0 0 1
13.5 94.5 36 0 0 1
13.5 121.5 36 0 0 1
13.5 148.5 36 0 0 1
13.5 175.5 36 0 0 1
13.5 202.5 36 0 0 1
13.5 229.5 36 0 0 1
13.5 256.5 36 0 0 1
13.5 283.5 36 0 0 1
13.5 310.5 36 0 0 1
40.5 13.5 36 0 0 1
40.5 40.5 36 0 0 1
40.5 67.5 36 0 0 1
40.5 94.5 36 0 0 1
40.5 121.5 36 0 0 1
40.5 148.5 36 0 0 1
40.5 175.5 36 0 0 1
40.5 202.5 36 0 0 1
40.5 229.5 36 0 0 1
40.5 256.5 36 0 0 1
40.5 283.5 36 0 0 1
40.5 310.5 36 0 0 1
67.5 13.5 36 0 0 1
67.5 40.5 36 0 0 1
67.5 67.5 36 0 0 1
67.5 94.5 36 0 0 1
67.5 121.5 36 0 0 1
67.5 148.5 36 0 0 1
67.5 175.5 36 0 0 1
67.5 202.5 36 0 0 1
67.5 229.5 36 0 0 1
67.5 256.5 36 0 0 1
67.5 283.5 36 0 0 1
67.5 310.5 36 0 0 1
94.5 13.5 36 0 0 1
94.5 40.5 36 0 0 1
94.5 67.5 36 0 0 1
94.5 94.5 36 0 0 1
94.5 121.5 36 0 0 1
94.5 148.5 36 0 0 1
94.5 175.5 36 0 0 1
94.5 202.5 36 0 0 1
94.5 229.5 36 0 0 1
94.5 256.5 36 0 0 1
94.5 283.5 36 0 0 1
94.5 310.5 36 0 0 1
121.5 13.5 36 0 0 1
121.5 40.5 36 0 0 1
121.5 67.5 36 0 0 1
121.5 94.5 36 0 0 1
121.5 121.5 36 0 0 1
121.5 148.5 36 0 0 1
121.5 175.5 36 0 0 1
121.5 202.5 36 0 0 1
121.5 229.5 36 0 0 1
121.5 256.5 36 0 0 1
121.5 283.5 36 0 0 1
121.5 310.5 36 0 0 1
148.5 13.5 36 0 0 1
148.5 40.5 36 0 0 1
148.5 67.5 36 0 0 1
148.5 94.5 36 0 0 1
148.5 121.5 36 0 0 1
148.5 148.5 36 0 0 1
148.5 175.5 36 0 0 1
148.5 202.5 36 0 0 1
148.5 229.5 36 0 0 1
148.5 256.5 36 0 0 1
148.5 283.5 36 0 0 1
148.5 310.5 36 0 0 1

The important part is that there were no x or y values of 0, and the points were not shifted. I probably got something wrong here, but these input positions were the values that I was expecting.

I hope somebody finds this useful.

ยทยทยท

On 22 May 2002, at 14:21, Greg Ward wrote: