|
|
> Ok, that makes me wonder, because:
>
> 1. The 2 methods above produce 100% identical images. It was a scene of
> one light emitting sphere, ground and 3 diffusing spheres of different
> colors. (I did use the cosine ratio relative to the angle of light
> falling on surface.) I can post the images if needed. The only
> difference is that the second method is faster - with a great margin.
>
> 2. If the distribution is not identical by the 2 methods, why are the
> images still 100% identical?
Actually yes, they are both the same, and wrong ;-) I hadn't checked your
y=sqrt(rand()) method, just assumed it was correct.
A correct way is:
y = rand(0...1);
phi = rand(0...2pi)
x = sqrt(1-y*y) * cos(phi)
z = sqrt(1-y*y) * sin(phi)
This will give a more even distribution, if you visualise the results you'll
see that your earlier attempts don't give many points around the equator.
Post a reply to this message
|
|