POV-Ray : Newsgroups : povray.beta-test : Radiosity Status: Giving Up... : Re: Radiosity Status: Giving Up... Server Time
28 Jul 2024 22:18:03 EDT (-0400)
  Re: Radiosity Status: Giving Up...  
From: Severi Salminen
Date: 29 Dec 2008 18:19:29
Message: <49595b01$1@news.povray.org>
And this is the code I use:


    double x,y,z;

    do{
        x = 2.0 * rNG.randomNumberClosed() - 1.0;
        z = 2.0 * rNG.randomNumberClosed() - 1.0;
    }
    while(x*x + z*z > 1.0);

    y = sqrt(1.0 - (x*x + z*z));


There you have it: a random vector inside a hemishere.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.