POV-Ray : Newsgroups : povray.general : Can you use the trace command on a heightfield? Server Time
4 Nov 2024 19:14:58 EST (-0500)
  Can you use the trace command on a heightfield? (Message 1 to 10 of 23)  
Goto Latest 10 Messages Next 10 Messages >>>
From: Dre
Subject: Can you use the trace command on a heightfield?
Date: 7 Apr 2010 21:20:25
Message: <4bbd2f59$1@news.povray.org>
Hi, as the title states, can you use the trace command on a heightfield?

I've been trying and trying and I cant get it to work.  I've successfully 
used the trace() command on isosurfaces and simple boxes, spheres but I cant 
for the life of me get this to work.

Just wondering if this actually does work or I'm barking up the wrong tree!

Cheers Dre


Post a reply to this message

From: Dre
Subject: Re: Can you use the trace command on a heightfield?
Date: 7 Apr 2010 23:42:56
Message: <4bbd50c0@news.povray.org>
"Dre" <and### [at] gmailcom> wrote in message 
news:4bbd2f59$1@news.povray.org...
> Hi, as the title states, can you use the trace command on a heightfield?
>
> I've been trying and trying and I cant get it to work.  I've successfully 
> used the trace() command on isosurfaces and simple boxes, spheres but I 
> cant for the life of me get this to work.
>
> Just wondering if this actually does work or I'm barking up the wrong 
> tree!
>
> Cheers Dre
>


Post a reply to this message

From: Dre
Subject: Re: Can you use the trace command on a heightfield?
Date: 7 Apr 2010 23:46:05
Message: <4bbd517d$1@news.povray.org>
"Dre" <and### [at] gmailcom> wrote in message 
news:4bbd2f59$1@news.povray.org...
> Hi, as the title states, can you use the trace command on a heightfield?
>
> I've been trying and trying and I cant get it to work.  I've successfully 
> used the trace() command on isosurfaces and simple boxes, spheres but I 
> cant for the life of me get this to work.
>
> Just wondering if this actually does work or I'm barking up the wrong 
> tree!
>
> Cheers Dre
>
Nevermind, I worked it out, that trace command has some weirdness about it.

This doesn't work:

#declare norm = <0, 0, 0>;
trace(object, <xPos, 10, zPos>, <xPos, -10, zPos>, norm>)

Yet this does:

#declare norm = <0, 0, 0>;
#declare startPoint =<xPos, 10, zPos>;
#declare endPoint = <xPos, -10, zPos>;
trace(object, startPoint, endPoint, norm)

Unless I'm doing something wrong, that seems broken to me...

Version 3.6 btw.

Cheers Dre


Post a reply to this message

From: Thomas de Groot
Subject: Re: Can you use the trace command on a heightfield?
Date: 8 Apr 2010 03:18:02
Message: <4bbd832a$1@news.povray.org>
"Dre" <and### [at] gmailcom> schreef in bericht 
news:4bbd517d$1@news.povray.org...
> "Dre" <and### [at] gmailcom> wrote in message 
> news:4bbd2f59$1@news.povray.org...
>> Hi, as the title states, can you use the trace command on a heightfield?
>>
>> I've been trying and trying and I cant get it to work.  I've successfully 
>> used the trace() command on isosurfaces and simple boxes, spheres but I 
>> cant for the life of me get this to work.
>>
>> Just wondering if this actually does work or I'm barking up the wrong 
>> tree!
>>
>> Cheers Dre
>>
> Nevermind, I worked it out, that trace command has some weirdness about 
> it.
>
> This doesn't work:
>
> #declare norm = <0, 0, 0>;
> trace(object, <xPos, 10, zPos>, <xPos, -10, zPos>, norm>)
>
> Yet this does:
>
> #declare norm = <0, 0, 0>;
> #declare startPoint =<xPos, 10, zPos>;
> #declare endPoint = <xPos, -10, zPos>;
> trace(object, startPoint, endPoint, norm)
>
> Unless I'm doing something wrong, that seems broken to me...
>


No, trace() is not broken. The following always works for me, with whatever 
object as target:
    #declare Norm =  <0, 0, 0>;
    #declare Start = <my.x, 10, my.z>;
    #declare Pos = trace (Obj, Start, -y, Norm);

Start must be above the object, so adapt the y value; -y indicates the 
direction of tracing.

Thomas


Post a reply to this message

From: clipka
Subject: Re: Can you use the trace command on a heightfield?
Date: 8 Apr 2010 05:20:54
Message: <4bbd9ff6$1@news.povray.org>
Am 08.04.2010 05:46, schrieb Dre:

>> I've been trying and trying and I cant get it to work.  I've successfully
>> used the trace() command on isosurfaces and simple boxes, spheres but I
>> cant for the life of me get this to work.

How does the failure-to-work manifest itself? Are we talking e.g. about 
a parser error?

> This doesn't work:
>
> #declare norm =<0, 0, 0>;
> trace(object,<xPos, 10, zPos>,<xPos, -10, zPos>, norm>)
>
> Yet this does:
>
> #declare norm =<0, 0, 0>;
> #declare startPoint =<xPos, 10, zPos>;
> #declare endPoint =<xPos, -10, zPos>;
> trace(object, startPoint, endPoint, norm)
>
> Unless I'm doing something wrong, that seems broken to me...

Well, unless you introduced a typo when writing this posting, I'm not at 
all surprised: In the non-working example, you have an extra ">" after 
"norm". I'm not sure what the parser makes of this, but most likely not 
what you expected.


Post a reply to this message

From: Warp
Subject: Re: Can you use the trace command on a heightfield?
Date: 8 Apr 2010 05:28:30
Message: <4bbda1be@news.povray.org>
Dre <and### [at] gmailcom> wrote:
> Yet this does:

> #declare norm = <0, 0, 0>;
> #declare startPoint =<xPos, 10, zPos>;
> #declare endPoint = <xPos, -10, zPos>;
> trace(object, startPoint, endPoint, norm)

  I don't think it does (well, not in the way you want). The third parameter
of trace() specifies a direction, not an endpoint.

  Probably you want the third parameter to be <0, -1, 0> because that's
the direction you are shooting the rays towards.

-- 
                                                          - Warp


Post a reply to this message

From: Dre
Subject: Re: Can you use the trace command on a heightfield?
Date: 8 Apr 2010 18:39:44
Message: <4bbe5b30@news.povray.org>
"clipka" <ano### [at] anonymousorg> wrote in message 
news:4bbd9ff6$1@news.povray.org...
> Am 08.04.2010 05:46, schrieb Dre:
>
>>> I've been trying and trying and I cant get it to work.  I've 
>>> successfully
>>> used the trace() command on isosurfaces and simple boxes, spheres but I
>>> cant for the life of me get this to work.
>
> How does the failure-to-work manifest itself? Are we talking e.g. about a 
> parser error?

No it parses correctly, however none of the intersections are correct, they 
are all either at <0, 0, 0> or some weird location.

>
>> This doesn't work:
>>
>> #declare norm =<0, 0, 0>;
>> trace(object,<xPos, 10, zPos>,<xPos, -10, zPos>, norm>)
>>
>> Yet this does:
>>
>> #declare norm =<0, 0, 0>;
>> #declare startPoint =<xPos, 10, zPos>;
>> #declare endPoint =<xPos, -10, zPos>;
>> trace(object, startPoint, endPoint, norm)
>>
>> Unless I'm doing something wrong, that seems broken to me...
>
> Well, unless you introduced a typo when writing this posting, I'm not at 
> all surprised: In the non-working example, you have an extra ">" after 
> "norm". I'm not sure what the parser makes of this, but most likely not 
> what you expected.

Ooops!  Yes that extra bracket is a typo, sorry.

I just find it weird that it accepts the same vectors as variables, but not 
as the actual vector itself...

Cheers Dre


Post a reply to this message

From: Dre
Subject: Re: Can you use the trace command on a heightfield?
Date: 8 Apr 2010 18:40:49
Message: <4bbe5b71$1@news.povray.org>
"Thomas de Groot" <tDOTdegroot@interDOTnlANOTHERDOTnet> wrote in message 
news:4bbd832a$1@news.povray.org...
>
> "Dre" <and### [at] gmailcom> schreef in bericht 
> news:4bbd517d$1@news.povray.org...
>> "Dre" <and### [at] gmailcom> wrote in message 
>> news:4bbd2f59$1@news.povray.org...
>>> Hi, as the title states, can you use the trace command on a heightfield?
>>>
>>> I've been trying and trying and I cant get it to work.  I've 
>>> successfully used the trace() command on isosurfaces and simple boxes, 
>>> spheres but I cant for the life of me get this to work.
>>>
>>> Just wondering if this actually does work or I'm barking up the wrong 
>>> tree!
>>>
>>> Cheers Dre
>>>
>> Nevermind, I worked it out, that trace command has some weirdness about 
>> it.
>>
>> This doesn't work:
>>
>> #declare norm = <0, 0, 0>;
>> trace(object, <xPos, 10, zPos>, <xPos, -10, zPos>, norm>)
>>
>> Yet this does:
>>
>> #declare norm = <0, 0, 0>;
>> #declare startPoint =<xPos, 10, zPos>;
>> #declare endPoint = <xPos, -10, zPos>;
>> trace(object, startPoint, endPoint, norm)
>>
>> Unless I'm doing something wrong, that seems broken to me...
>>
>
>
> No, trace() is not broken. The following always works for me, with 
> whatever object as target:
>    #declare Norm =  <0, 0, 0>;
>    #declare Start = <my.x, 10, my.z>;
>    #declare Pos = trace (Obj, Start, -y, Norm);
>
> Start must be above the object, so adapt the y value; -y indicates the 
> direction of tracing.
>
> Thomas
>

Yes that format works for me too, now try your example without the 
variables, put the actual vectors in your Pos declaration and see if you get 
the same results.  I dont.

Cheers Dre


Post a reply to this message

From: Dre
Subject: Re: Can you use the trace command on a heightfield?
Date: 8 Apr 2010 18:48:17
Message: <4bbe5d31$1@news.povray.org>
"Warp" <war### [at] tagpovrayorg> wrote in message 
news:4bbda1be@news.povray.org...
> Dre <and### [at] gmailcom> wrote:
>> Yet this does:
>
>> #declare norm = <0, 0, 0>;
>> #declare startPoint =<xPos, 10, zPos>;
>> #declare endPoint = <xPos, -10, zPos>;
>> trace(object, startPoint, endPoint, norm)
>
>  I don't think it does (well, not in the way you want). The third 
> parameter
> of trace() specifies a direction, not an endpoint.
>
>  Probably you want the third parameter to be <0, -1, 0> because that's
> the direction you are shooting the rays towards.
>
> -- 
>                                                          - Warp

Well it does to what I want now that I changed the way I coded it to the 
example above.  I then modified the norm as you stated but it didn't make 
any difference at all.  Both my norm and yours are below my start point so 
they are essentially shooting the rays in the same direction.

Cheers Dre


Post a reply to this message

From: Warp
Subject: Re: Can you use the trace command on a heightfield?
Date: 9 Apr 2010 01:48:32
Message: <4bbebfaf@news.povray.org>
Dre <and### [at] gmailcom> wrote:
> "Warp" <war### [at] tagpovrayorg> wrote in message 
> news:4bbda1be@news.povray.org...
> > Dre <and### [at] gmailcom> wrote:
> >> Yet this does:
> >
> >> #declare norm = <0, 0, 0>;
> >> #declare startPoint =<xPos, 10, zPos>;
> >> #declare endPoint = <xPos, -10, zPos>;
> >> trace(object, startPoint, endPoint, norm)
> >
> >  I don't think it does (well, not in the way you want). The third 
> > parameter
> > of trace() specifies a direction, not an endpoint.
> >
> >  Probably you want the third parameter to be <0, -1, 0> because that's
> > the direction you are shooting the rays towards.
> >
> > -- 
> >                                                          - Warp

> Well it does to what I want now that I changed the way I coded it to the 
> example above.  I then modified the norm as you stated but it didn't make 
> any difference at all.  Both my norm and yours are below my start point so 
> they are essentially shooting the rays in the same direction.

  The normal is the *fourth* parameter. I was talking about the *third*
parameter, which is the direction. That should be <0, -1, 0>.

-- 
                                                          - Warp


Post a reply to this message

Goto Latest 10 Messages Next 10 Messages >>>

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