POV-Ray : Newsgroups : povray.programming : trace in function Server Time
28 Jul 2024 10:29:04 EDT (-0400)
  trace in function (Message 1 to 8 of 8)  
From: Mael
Subject: trace in function
Date: 10 Sep 2001 03:25:46
Message: <3b9c6afa@news.povray.org>
i know it s too late for pov3.5 but maybe an idea for futur patches : what
about adding a "trace function" for functions ? something like
ftrace(start,dir,object) which return 1 if the ray intersect "object" and
else 0 . This would allow a visibility pattern , a projection pattern , etc

M


Post a reply to this message

From: Mark Wagner
Subject: Re: trace in function
Date: 11 Sep 2001 01:14:25
Message: <3b9d9db1@news.povray.org>
Mael wrote in message <3b9c6afa@news.povray.org>...
>i know it s too late for pov3.5 but maybe an idea for futur patches : what
>about adding a "trace function" for functions ? something like
>ftrace(start,dir,object) which return 1 if the ray intersect "object" and
>else 0 . This would allow a visibility pattern , a projection pattern , etc


What could this do that "trace()", which is in POV 3.5, can't do?

--
Mark


Post a reply to this message

From: Ron Parker
Subject: Re: trace in function
Date: 11 Sep 2001 01:26:14
Message: <slrn9pr83q.hlh.ron.parker@fwi.com>
On Tue, 11 Sep 2001 00:52:21 -0400, Mark Wagner wrote:
>
>Mael wrote in message <3b9c6afa@news.povray.org>...
>>i know it s too late for pov3.5 but maybe an idea for futur patches : what
>>about adding a "trace function" for functions ? something like
>>ftrace(start,dir,object) which return 1 if the ray intersect "object" and
>>else 0 . This would allow a visibility pattern , a projection pattern , etc
>
>
>What could this do that "trace()", which is in POV 3.5, can't do?

Be used in functions.

Unfortunately, that doesn't work.  By the time a function gets parsed, the
#declared object you passed to trace() has been returned to the bit-bucket.
This would be a major change.

-- 
#macro R(L P)sphere{L F}cylinder{L P F}#end#macro P(V)merge{R(z+a z)R(-z a-z)R(a
-z-z-z a+z)torus{1F clipped_by{plane{a 0}}}translate V}#end#macro Z(a F T)merge{
P(z+a)P(z-a)R(-z-z-x a)pigment{rgbt 1}hollow interior{media{emission T}}finish{
reflection.1}}#end Z(-x-x.2y)Z(-x-x.4x)camera{location z*-10rotate x*90}


Post a reply to this message

From: ingo
Subject: Re: trace in function
Date: 11 Sep 2001 03:00:21
Message: <Xns91195B9CF3494seed7@povray.org>
in news:slr### [at] fwicom Ron Parker wrote:

> Unfortunately, that doesn't work.  By the time a function gets
> parsed, the #declared object you passed to trace() has been
> returned to the bit-bucket. This would be a major change.
> 

And what if it just works with the object that currently is ray-traced, 
not with a declared object?

sphere {
  0,1
  pigment {
    function {
      select(trace(...), ..., ...)
    }
    colour_map {
    	...
    }
  }
}

Gives some result on the first object-ray intersection that can be used 
in the pigment calculation

Ingo

-- 
Photography: http://members.home.nl/ingoogni/
Pov-Ray    : http://members.home.nl/seed7/


Post a reply to this message

From: Michael Andrews
Subject: Re: trace in function
Date: 12 Sep 2001 06:05:47
Message: <3B9F3515.160AF1EA@reading.ac.uk>
Ron Parker wrote:
[snip]
> Unfortunately, that doesn't work.  By the time a function gets parsed, the
> #declared object you passed to trace() has been returned to the bit-bucket.
> This would be a major change.
[snip]

And yet you can use the 'object' pattern in a function? Sorry if I'm
being dense, but doesn't this use much of the same information?

Maybe when I can look at the v3.5 source code I'll see just how silly a
question that is ... :-(

Mike Andrews.


Post a reply to this message

From: Warp
Subject: Re: trace in function
Date: 13 Sep 2001 04:46:52
Message: <3ba0727b@news.povray.org>
Michael Andrews <M.C### [at] readingacuk> wrote:
: And yet you can use the 'object' pattern in a function?

  I think that you just gave inavertetly the solution to the original question.

-- 
#macro N(D,I)#if(I<6)cylinder{M()#local D[I]=div(D[I],104);M().5,2pigment{
rgb M()}}N(D,(D[I]>99?I:I+1))#end#end#macro M()<mod(D[I],13)-6,mod(div(D[I
],13),8)-3,10>#end blob{N(array[6]{11117333955,
7382340,3358,3900569407,970,4254934330},0)}//                     - Warp -


Post a reply to this message

From: Mael
Subject: Re: trace in function
Date: 13 Sep 2001 07:08:02
Message: <3ba09392$1@news.povray.org>
> : And yet you can use the 'object' pattern in a function?
>
>   I think that you just gave inavertetly the solution to the original
question.

?

some times ago i wrote a little patch for megapov
(http://195.221.122.126/tmp/), mainly to learn about pov sources, and i
programm a projection pattern (http://195.221.122.126/tmp/projection.html) .

Do you mean we can achieve the same results with the object pattern ? how ??

M


Post a reply to this message

From: Warp
Subject: Re: trace in function
Date: 13 Sep 2001 07:48:08
Message: <3ba09cf8@news.povray.org>
Mael <mae### [at] hotmailcom> wrote:
:>   I think that you just gave inavertetly the solution to the original
: question.

: ?

  Hmm... It seems that I confused two concepts (object interior and ray-object
intersection) in my mind. Perhaps because so many things have happened
lately and I'm not fully concentrated...
  Just forget my comment.

-- 
#macro N(D,I)#if(I<6)cylinder{M()#local D[I]=div(D[I],104);M().5,2pigment{
rgb M()}}N(D,(D[I]>99?I:I+1))#end#end#macro M()<mod(D[I],13)-6,mod(div(D[I
],13),8)-3,10>#end blob{N(array[6]{11117333955,
7382340,3358,3900569407,970,4254934330},0)}//                     - Warp -


Post a reply to this message

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