POV-Ray : Newsgroups : povray.general : Can you use the trace command on a heightfield? Server Time
30 Jul 2024 06:21:55 EDT (-0400)
  Can you use the trace command on a heightfield? (Message 21 to 23 of 23)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Dre
Subject: Re: Can you use the trace command on a heightfield?
Date: 12 Apr 2010 21:02:27
Message: <4bc3c2a3$1@news.povray.org>
"Kenneth" <kdw### [at] earthlinknet> wrote in message 
news:web.4bc2e33970f2d07d65f302820@news.povray.org...
> "Dre" <and### [at] gmailcom> wrote:
>
>> So much POV to learn, so little time!
>
> Not a day goes by that I don't learn something new as well, some new trick 
> that
> POV-Ray is capable of, or some new 'understanding.' The best way to learn
> is...practice, practice, practice.  ;-) And to read these newsgroups, of
> course--they are a real fountain of knowledge.
>
> I remember the trace command being difficult to fully understand as well, 
> when I
> first tried to use it. (In fact, a newsgroup query may have helped *me* at 
> the
> time.) And that Norm thing had me guessing too--until I finally
> realized that the value (the vector) that's placed there--with #declare 
> norm =
> <0,0,0> --is just to set it up, as a kind of 'place-holder.' (In fact, the
> vector can contain *any* three values.) Then, when trace() is used or 
> called, it
> RETURNS an *actual* vector (a directional vector again!) found at the 
> traced
> point, and loads it into 'norm', replacing the temporary values--which can 
> then
> be used elsewhere in the scene. The documentation describes some of this, 
> but in
> a roundabout way, not completely clear. (Which is unfortunate, because 
> trace is
> an *extremely* valuable and fun tool!) So don't feel bad about your 
> temporary
> lack of understanding.
>
> Ken
>
I totally agree.  There is something very satisfying when you see your scene 
finally trace correctly after working out some new process/technique.

Without these groups I would be stuck a long time ago, not to mention the 
absolutely amazing pictures you see in p.bi.

Cheers Dre


Post a reply to this message

From: Dre
Subject: Re: Can you use the trace command on a heightfield?
Date: 12 Apr 2010 21:02:58
Message: <4bc3c2c2@news.povray.org>
"Warp" <war### [at] tagpovrayorg> wrote in message 
news:4bc308a1@news.povray.org...
> Dre <and### [at] gmailcom> wrote:
>> >  The normal is the *fourth* parameter. I was talking about the *third*
>> > parameter, which is the direction. That should be <0, -1, 0>.
>> >
>> > -- 
>> >                                                          - Warp
>
>> What difference does it make if its -1 or -10, they are both in the same
>> plane.
>
>  <X, -10, Z> is not the same thing as <0, -10, 0>.
>
>> Or are you saying the 3rd parameters is a direction vector not a final 
>> end
>> point vector?
>
>  It's a direction vector.
>
> -- 
>                                                          - Warp

Yep, that was where I was going wrong.

Thanks for your help!

Cheers Dre


Post a reply to this message

From: Dre
Subject: Re: Can you use the trace command on a heightfield?
Date: 12 Apr 2010 21:04:52
Message: <4bc3c334$1@news.povray.org>
"Alain" <aze### [at] qwertyorg> wrote in message 
news:4bc31c84$1@news.povray.org...

>> "Warp"<war### [at] tagpovrayorg>  wrote in message
>> news:4bbebfde@news.povray.org...
>>> Dre<and### [at] gmailcom>  wrote:
>>>> No it parses correctly, however none of the intersections are correct,
>>>> they
>>>> are all either at<0, 0, 0>  or some weird location.
>>>
>>>   Because you are not shooting the rays towards<0, -1, 0>.
>>>
>>> --
>>>                                                           - Warp
>>
>> I believe I am shooting them in that direction, they are starting at<x, 
>> 10,
>> z>  and finishing at<x, -10, y>, thats towards<0, -1, 0>  in my mind or 
>> am I
>> wrong here?
>>
>> Cheers Dre
>>
>>
>
> You are wrong :(
>
> If you start at <x,10,z> and have a direction of <x,-10,z>, then, you 
> shoot toward <x*2,0, z*2>.
> Remember, the first value is the starting location.
>
> The second value is a *direction* vector, it is ADDED to the start 
> location. If you use a /location/ your tracing rays will fan out.
>
> The result is that most rays, about 75% if the hight_field is around the 
> X-Z plane, will totaly miss the hight_field. Any ray that don't hit the 
> target will return a location of <0,0,0> and a normal of <0,0,0>.
> If the hight_field is a around -10*y, then only 1/16 trace will hit it, at 
> the wrong locations.
>
>
>
> Alain

Yep, the thing that was messing me up was the fact that I thought the second 
value was the final end point not a direction vector.

All sorted now though, thanks for your help!

Cheers Dre


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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