POV-Ray : Newsgroups : povray.advanced-users : Use Slope pattern for Planting distribution? Server Time
6 Oct 2024 17:21:31 EDT (-0400)
  Use Slope pattern for Planting distribution? (Message 11 to 20 of 25)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 5 Messages >>>
From: Warp
Subject: Re: Use Slope pattern for Planting distribution?
Date: 13 Dec 2006 04:34:29
Message: <457fc925@news.povray.org>
Thomas de Groot <t.d### [at] internldotnet> wrote:
>     #if (Norm.x != 0 | Norm.y != 0 | Norm.z != 0)

  Btw, another way of testing that is:

  #if(vlength(Norm) > 0)

>       #if ((vdot(Norm, y)>0.5) & (Pos.y < 5.5))

  Does trace() always return a normalized vector?

-- 
                                                          - Warp


Post a reply to this message

From: Thomas de Groot
Subject: Re: Use Slope pattern for Planting distribution?
Date: 13 Dec 2006 07:20:39
Message: <457ff017$1@news.povray.org>
"Warp" <war### [at] tagpovrayorg> schreef in bericht 
news:457fc925@news.povray.org...
> Thomas de Groot <t.d### [at] internldotnet> wrote:
>>     #if (Norm.x != 0 | Norm.y != 0 | Norm.z != 0)
>
>  Btw, another way of testing that is:
>
>  #if(vlength(Norm) > 0)

Ah, yes! that's neat!

>
>>       #if ((vdot(Norm, y)>0.5) & (Pos.y < 5.5))
>
>  Does trace() always return a normalized vector?
>

Yes, if you define also the fourth trace parameter (a vector), Norm in this 
case (see documentation 3.2.1.4.5). This works fine as far as I can tell. To 
tell the truth, I used this after an example from somebody else :-)  So, 
things are transmitted on. However, there might be an even better way to do 
this, but I have not investigated that far as this worked for me.

Thomas


Post a reply to this message

From: Warp
Subject: Re: Use Slope pattern for Planting distribution?
Date: 13 Dec 2006 16:38:12
Message: <458072c4@news.povray.org>
Thomas de Groot <t.d### [at] internldotnet> wrote:
> >  Does trace() always return a normalized vector?

> Yes, if you define also the fourth trace parameter (a vector), Norm in this 
> case (see documentation 3.2.1.4.5).

  There's no such section number in the current documentation
(http://povray.org/documentation/view/3.6.1/570/)

  As for the documentation on the trace() function (2.2.1.4.5), it does not
mention returning a normalized vector.

-- 
                                                          - Warp


Post a reply to this message

From: Thomas de Groot
Subject: Re: Use Slope pattern for Planting distribution?
Date: 14 Dec 2006 04:03:35
Message: <45811367@news.povray.org>
"Warp" <war### [at] tagpovrayorg> schreef in bericht 
news:458072c4@news.povray.org...
> Thomas de Groot <t.d### [at] internldotnet> wrote:
>> >  Does trace() always return a normalized vector?
>
>> Yes, if you define also the fourth trace parameter (a vector), Norm in 
>> this
>> case (see documentation 3.2.1.4.5).
>
>  There's no such section number in the current documentation
> (http://povray.org/documentation/view/3.6.1/570/)
>
>  As for the documentation on the trace() function (2.2.1.4.5), it does not
> mention returning a normalized vector.
>

Strange....
My documentation for version 3.6 is headed:   3.2.1.4.5  Functions
This is what it says about trace():
quote
trace(OBJECT_IDENTIFIER, A, B, [VECTOR_IDENTIFIER]). trace helps you finding 
the exact location of a ray intersecting with an object's surface. It traces 
a ray beginning at the point A in the direction specified by the vector B. 
If the ray hits the specified object, this function returns the coordinate 
where the ray intersected the object. If not, it returns <0,0,0>. If a 
fourth parameter in the form of a vector identifier is provided, the normal 
of the object at the intersection point (not including any normal 
perturbations due to textures) is stored into that vector. If no 
intersection was found, the normal vector is reset to <0,0,0>.
Note: Checking the normal vector for <0,0,0> is the only reliable way to 
determine whether an intersection has actually occurred, intersections can 
and do occur anywhere, including at <0,0,0>.

unquote

so.... what do you think?

Thomas


Post a reply to this message

From: Alain
Subject: Re: Use Slope pattern for Planting distribution?
Date: 14 Dec 2006 05:52:06
Message: <45812cd6$1@news.povray.org>
Thomas de Groot nous apporta ses lumieres en ce 14-12-2006 04:03:
> "Warp" <war### [at] tagpovrayorg> schreef in bericht 
> news:458072c4@news.povray.org...
>> Thomas de Groot <t.d### [at] internldotnet> wrote:
>>>>  Does trace() always return a normalized vector?
>>> Yes, if you define also the fourth trace parameter (a vector), Norm in 
>>> this
>>> case (see documentation 3.2.1.4.5).
>>  There's no such section number in the current documentation
>> (http://povray.org/documentation/view/3.6.1/570/)

>>  As for the documentation on the trace() function (2.2.1.4.5), it does not
>> mention returning a normalized vector.


> Strange....
> My documentation for version 3.6 is headed:   3.2.1.4.5  Functions
> This is what it says about trace():
> quote
> trace(OBJECT_IDENTIFIER, A, B, [VECTOR_IDENTIFIER]). trace helps you finding 
> the exact location of a ray intersecting with an object's surface. It traces 
> a ray beginning at the point A in the direction specified by the vector B. 
> If the ray hits the specified object, this function returns the coordinate 
> where the ray intersected the object. If not, it returns <0,0,0>. If a 
> fourth parameter in the form of a vector identifier is provided, the normal 
> of the object at the intersection point (not including any normal 
> perturbations due to textures) is stored into that vector. If no 
> intersection was found, the normal vector is reset to <0,0,0>.
> Note: Checking the normal vector for <0,0,0> is the only reliable way to 
> determine whether an intersection has actually occurred, intersections can 
> and do occur anywhere, including at <0,0,0>.

> unquote

> so.... what do you think?

> Thomas




There is no mention of a normalised normal vector, it mention the normal vector.

-- 
Alain
-------------------------------------------------
A day for firm decisions!!!!!  Or is it?


Post a reply to this message

From: Warp
Subject: Re: Use Slope pattern for Planting distribution?
Date: 14 Dec 2006 07:01:26
Message: <45813d16@news.povray.org>
Thomas de Groot <t.d### [at] internldotnet> wrote:
> so.... what do you think?

  Yes, there's no mention of the returned vector being normalized. Thus
it may not be wise to assume it is, and thus it would be wise to use
vnormalize(), just in case.

-- 
                                                          - Warp


Post a reply to this message

From: Thomas de Groot
Subject: Re: Use Slope pattern for Planting distribution?
Date: 14 Dec 2006 09:16:58
Message: <45815cda@news.povray.org>
"Warp" <war### [at] tagpovrayorg> schreef in bericht 
news:45813d16@news.povray.org...
> Thomas de Groot <t.d### [at] internldotnet> wrote:
>> so.... what do you think?
>
>  Yes, there's no mention of the returned vector being normalized. Thus
> it may not be wise to assume it is, and thus it would be wise to use
> vnormalize(), just in case.
>

OK. There is something that I am missing here obviously. When you mention 
normalize, I think normal. To tell the truth, I have never thought about the 
difference, and as things work perfectly well (in the case of trace to plant 
my trees) I never thought further. However, I wonder about the difference. I 
read the docs, but except for hardly two lines of text, I find no mention of 
what the importance of vnormalize() is and what it is supposed to do. Could 
you please explain?

Thomas


Post a reply to this message

From: Gilles Tran
Subject: Re: Use Slope pattern for Planting distribution?
Date: 14 Dec 2006 12:26:45
Message: <45818955@news.povray.org>

45813d16@news.povray.org...
> Thomas de Groot <t.d### [at] internldotnet> wrote:
>> so.... what do you think?
>
>  Yes, there's no mention of the returned vector being normalized. Thus
> it may not be wise to assume it is, and thus it would be wise to use
> vnormalize(), just in case.

Just ran a test with the Makesnow macro and it looks to be normalized indeed 
(all vlength(Norm)=1). It's just not documented probably.

G.


Post a reply to this message

From: Warp
Subject: Re: Use Slope pattern for Planting distribution?
Date: 14 Dec 2006 14:26:55
Message: <4581a57f@news.povray.org>
Thomas de Groot <t.d### [at] internldotnet> wrote:
> OK. There is something that I am missing here obviously. When you mention 
> normalize, I think normal. To tell the truth, I have never thought about the 
> difference

  Despite the similarity in the names of the terms, a normal vector and a
normalized vector talk about two different things:

  - A normal vector is a vector perpendicular to a surface (or line in 2D)
at a certain point.
  - A normalized vector is a vector of length 1.

  Thus a normalized normal vector is a normal vector of length 1.

  The dot product returns values between 0 and 1 only if the two vectors
are normalized.
  (More specifically, the dot product is the product of the lengths of
the two vectors and the cosine of the angle between them. Naturally if
both lengths are 1, the result is just the cosine.)

-- 
                                                          - Warp


Post a reply to this message

From: Thomas de Groot
Subject: Re: Use Slope pattern for Planting distribution?
Date: 15 Dec 2006 02:57:35
Message: <4582556f@news.povray.org>
"Warp" <war### [at] tagpovrayorg> schreef in bericht 
news:4581a57f@news.povray.org...
>
>  Despite the similarity in the names of the terms, a normal vector and a
> normalized vector talk about two different things:
>
>  - A normal vector is a vector perpendicular to a surface (or line in 2D)
> at a certain point.
>  - A normalized vector is a vector of length 1.
>
>  Thus a normalized normal vector is a normal vector of length 1.
>
>  The dot product returns values between 0 and 1 only if the two vectors
> are normalized.
>  (More specifically, the dot product is the product of the lengths of
> the two vectors and the cosine of the angle between them. Naturally if
> both lengths are 1, the result is just the cosine.)
>

Thanks Warp! This makes it clear for me. Perhaps it would be a suggestion to 
add something like this in the documentation? I think that would be useful.

Thomas


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 5 Messages >>>

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