POV-Ray : Newsgroups : povray.general : Random but constrained vector Server Time
19 Nov 2024 07:37:23 EST (-0500)
  Random but constrained vector (Message 1 to 5 of 5)  
From: Tom Melly
Subject: Random but constrained vector
Date: 17 Apr 2002 17:31:13
Message: <3cbde9a1@news.povray.org>
Given a vector <a,b,c>, how would I go about calculating a new vector within
x degrees of the original vector?

i.e. given a cone:

cone{<1,1,1>, 25, <0,0,0>,0}

a random vector within 25 degrees would lie within the cone's radius.


Post a reply to this message

From: Jan Walzer
Subject: Re: Random but constrained vector
Date: 17 Apr 2002 17:50:28
Message: <3cbdee24@news.povray.org>
OK, given the vector:


V:  |------------>
    A            B

I'd rotate first this vector V around
any axis, that is perpendicular to V
and goes through A. Here you can use
any angle between 0 and 25 degree.
Afterwards you rotate this new vector
around the axis of the original vector V
by any random angle ...

This should work, but would merely give
an equal distribution of the results ...
So if this should be your goal, there is
probably a better method.

BTW: Are you sure, that your given Cone


Post a reply to this message

From: Tom Melly
Subject: Re: Random but constrained vector
Date: 18 Apr 2002 04:39:10
Message: <3cbe862e$1@news.povray.org>
"Jan Walzer" <jan### [at] lzernet> wrote in message news:3cbdee24@news.povray.org...
>
> OK, given the vector:
>
>
> V:  |------------>
>     A            B
>
> I'd rotate first this vector V around
> any axis, that is perpendicular to V
> and goes through A. Here you can use
> any angle between 0 and 25 degree.
> Afterwards you rotate this new vector
> around the axis of the original vector V
> by any random angle ...

Makes sense - god, I'm dumb.

> BTW: Are you sure, that your given Cone


Ah - of course it doesn't. What was I thinking? Got it into my head the 4th
param was the angle, not the radius.


Post a reply to this message

From: Tom Melly
Subject: Re: Random but constrained vector
Date: 18 Apr 2002 04:39:32
Message: <3cbe8644$1@news.povray.org>
"Tom Melly" <tom### [at] tomandlucouk> wrote in message
news:3cbde9a1@news.povray.org...
> cone{<1,1,1>, 25, <0,0,0>,0}
>
> a random vector within 25 degrees would lie within the cone's radius.
>

Which, of course, is nonsense....


Post a reply to this message

From: John VanSickle
Subject: Re: Random but constrained vector
Date: 18 Apr 2002 15:35:30
Message: <3CBF2105.69B586F6@hotmail.com>
Tom Melly wrote:
> 
> Given a vector <a,b,c>, how would I go about calculating a new vector
> within x degrees of the original vector?

Depends on what kind of distribution you want.  If the vectors in the
cone are equally likely, the method is different from, say, having the
ones around the center be more likely than the rest.

Regards,
John
-- 
Rusty is rendering!


Post a reply to this message

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