POV-Ray : Newsgroups : povray.off-topic : Random vector through a hemisphere? : Re: Random vector through a hemisphere? Server Time
10 Oct 2024 21:17:37 EDT (-0400)
  Re: Random vector through a hemisphere?  
From: John VanSickle
Date: 17 Feb 2008 13:17:46
Message: <47b87a4a@news.povray.org>
Another way is to generate a random vector:

#local vResult=vrotate(x,<rand(Seed),rand(Seed),rand(Seed)>*360);

#if(vdot(vResult,vN)<0)
   #local vResult=-vResult;
#end

Basically, generate a random vector, and if it's in the wrong 
hemisphere, flip its direction.

Regards,
John


Post a reply to this message

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