1 
# lines 
2 
# from build_jos_eye_source.pl 
3 
# read 1 files in the txt format 
4 
# 2. Distance of points 
5 
# 3. intensity of points 
6 

7 
srand(1283191); 
8 

9 

10 
while (<>) { 
11 
$s=$_; 
12 
($x,$y,$r,$g,$b) = split(/\/,$s); 
13 
$avg = ($r+$g+$b)/3.0; 
14 
if ($avg > 245) {$avg = $avg * 2.0;} 
15 
elsif ($avg<180) {$avg = $avg * .5;} 
16 
$d = (0.75 + 100.0 * (($avg) / 255.)); 
17 

18 
# $d = $d + rand(70)/2600; # slight variance in height 
19 
$phase = rand(3.1415927*2.0); 
20 
# $phase = 0; 
21 
$x = $x * 20800.0/7095.0; 
22 
$y = $y * 33048.0/11273.0; 
23 
$z = $d / 3.2808399; # convert from feet to meters 
24 
$z = $z * 0.25 + 0.081; # scale back 
25 
print "$x$y$z14.71" . "e07$phase\n"; 
26 
} 
27 
