POV-Ray : Newsgroups : povray.programming : Randomly deviated vector : Re: Randomly deviated vector Server Time
18 May 2024 02:13:36 EDT (-0400)
  Re: Randomly deviated vector  
From: Thorsten Froehlich
Date: 25 Oct 2006 22:06:40
Message: <45401830$1@news.povray.org>
Paris wrote:
> I am currently writing a physically-based rendering engine.  I need to
> deviate 3-Dimensional vectors in a random "cone" whose principle axis is
> equal to the vector itself.  The size of the "cone" is pregiven in
> steradians.
> 
> I understand that povray uses a lookup table to get directions for radiosity
> samples.   I do not have this option.

The radiosity samples in POV-Ray are actually distributed on a hemisphere.
they were once generated with a good algorithm randomly, but there is
nothing inherently forcing you to have a fixed table other than speed.

My guess is that ideally you want to use a hemisphere, too, but determined a
cone is simpler? Or is that a cone as in cone-tracing? Either way, although
I am not sure I understand your problem correctly, the best advice would be
to check out: <http://www.boost.org/libs/random/index.html> if you need a
good set of random number generators. It also comes with a mapping for
spheres that is really useful.

	Thorsten


Post a reply to this message

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