1 |
|
/* |
2 |
< |
=============================================================== |
2 |
> |
================================================================== |
3 |
|
Dump photon maps as RADIANCE scene description to stdout |
4 |
|
|
5 |
|
Roland Schregle (roland.schregle@{hslu.ch, gmail.com}) |
6 |
|
(c) Fraunhofer Institute for Solar Energy Systems, |
7 |
< |
Lucerne University of Applied Sciences & Arts |
7 |
> |
(c) Lucerne University of Applied Sciences and Arts, |
8 |
> |
supported by the Swiss National Science Foundation (SNSF, #147053) |
9 |
|
================================================================== |
10 |
|
|
11 |
|
$Id$ |
19 |
|
#include "rtio.h" |
20 |
|
#include "resolu.h" |
21 |
|
#include "random.h" |
22 |
+ |
#include "math.h" |
23 |
|
|
24 |
|
|
25 |
|
/* Defaults */ |
168 |
|
(= sphere distrib density ^-1/3) */ |
169 |
|
vol = (maxPos [0] - minPos [0]) * (maxPos [1] - minPos [1]) * |
170 |
|
(maxPos [2] - minPos [2]); |
171 |
< |
rad = radScale * RADCOEFF * cbrt(vol / numSpheres); |
171 |
> |
rad = radScale * RADCOEFF * pow(vol / numSpheres, 1./3.); |
172 |
|
|
173 |
|
/* Photon dump probability to satisfy target sphere count */ |
174 |
|
dumpRatio = numSpheres < numPhotons ? (float)numSpheres / numPhotons |