POV-Ray : Newsgroups : povray.unofficial.patches : Patch enhancement request - Trace keyword Server Time
1 Nov 2024 19:14:23 EDT (-0400)
  Patch enhancement request - Trace keyword (Message 1 to 10 of 15)  
Goto Latest 10 Messages Next 5 Messages >>>
From: SamuelT
Subject: Patch enhancement request - Trace keyword
Date: 30 Jun 2000 15:01:02
Message: <395CEF4B.AA746BF@aol.com>
Hello. I was wondering if somebody knows if it is possible to add a new
feature to the trace( ) command. I'm thinking of a new keyword that
makes trace rocognize all the objects in a scene. The keyword would be
placed like so:

trace( all_objects, Start, End, Nomal )

The feature would make it possible to create objects which fall from a
location and stack on each other. I hope it is possible, thanks for
reading :)

~Samuel


Post a reply to this message

From: Ron Parker
Subject: Re: Patch enhancement request - Trace keyword
Date: 30 Jun 2000 15:13:20
Message: <slrn8lpt0i.1sj.ron.parker@linux.parkerr.fwi.com>
On Fri, 30 Jun 2000 12:04:46 -0700, SamuelT wrote:
>Hello. I was wondering if somebody knows if it is possible to add a new
>feature to the trace( ) command. I'm thinking of a new keyword that
>makes trace rocognize all the objects in a scene. The keyword would be
>placed like so:
>
>trace( all_objects, Start, End, Nomal )

I'm not sure how difficult it would be, but you could simulate it by
adding the objects that are falling to a union as well as to the scene, 
and tracing against the union.

-- 
Ron Parker   http://www2.fwi.com/~parkerr/traces.html
My opinions.  Mine.  Not anyone else's.


Post a reply to this message

From: SamuelT
Subject: Re: Patch enhancement request - Trace keyword
Date: 30 Jun 2000 15:34:41
Message: <395CF731.68F4887E@aol.com>
I'll try that, thanks.

~Samuel

Ron Parker wrote:

> On Fri, 30 Jun 2000 12:04:46 -0700, SamuelT wrote:
> >Hello. I was wondering if somebody knows if it is possible to add a new
> >feature to the trace( ) command. I'm thinking of a new keyword that
> >makes trace rocognize all the objects in a scene. The keyword would be
> >placed like so:
> >
> >trace( all_objects, Start, End, Nomal )
>
> I'm not sure how difficult it would be, but you could simulate it by
> adding the objects that are falling to a union as well as to the scene,
> and tracing against the union.
>
> --
> Ron Parker   http://www2.fwi.com/~parkerr/traces.html
> My opinions.  Mine.  Not anyone else's.


Post a reply to this message

From: SamuelT
Subject: Stacking spheres - was Re: Patch enhancement request - Trace keyword
Date: 30 Jun 2000 16:14:10
Message: <395D0070.5525367B@aol.com>
Okay, I tried the idea, and it works, but pov crashes if I go through 200 or
more loops. Here is my code:


#$ X=0; #$ Y=0; #$ Num=0; #$ Z=0; #$ Norm=<0,0,0>; #$ R=seed(75);
#$ SlopeV=.9999975;

#declare Obj=
  box{<-2,-1,-2>,<2,0,2> pigment{rgb 1}}

#while(Num<100)
 #$ X=rand(R)*4-2; #$ Z=rand(R)*4-2;
 #$ Vect=trace( Obj, <X,100,Z>, -y );
 #local Obj=
  union{
   sphere{<X,Vect.y+.1,Z>,.1 pigment{rgb 1}}
   #object{Obj}
  }
 #$ Num=Num+1;
#end

#object{Obj}

~Samuel


Post a reply to this message

From: Chris Huff
Subject: Re: Patch enhancement request - Trace keyword
Date: 30 Jun 2000 16:22:42
Message: <chrishuff-B423AC.15224730062000@news.povray.org>
In article <395### [at] aolcom>, STB### [at] aolcom wrote:

> Hello. I was wondering if somebody knows if it is possible to add a new
> feature to the trace( ) command. I'm thinking of a new keyword that
> makes trace rocognize all the objects in a scene. The keyword would be
> placed like so:
> 
> trace( all_objects, Start, End, Nomal )
> 
> The feature would make it possible to create objects which fall from a
> location and stack on each other. I hope it is possible, thanks for
> reading :)

This isn't possible. How would you trace against an object that depends 
on the call to trace? And what about other objects that haven't been 
created yet? Etc...
Having it only trace objects already created might be possible, but 
would be a real headache to debug scenes using this option, and wouldn't 
really be that useful.
The best solution is usually to use a union of all the objects you want 
to trace against as the target object.

-- 
Christopher James Huff - Personal e-mail: chr### [at] maccom
TAG(Technical Assistance Group) e-mail: chr### [at] tagpovrayorg
Personal Web page: http://homepage.mac.com/chrishuff/
TAG Web page: http://tag.povray.org/


Post a reply to this message

From: Ron Parker
Subject: Re: Patch enhancement request - Trace keyword
Date: 30 Jun 2000 16:30:58
Message: <slrn8lq1i5.1u8.ron.parker@linux.parkerr.fwi.com>
On Fri, 30 Jun 2000 13:10:02 -0700, SamuelT wrote:
>Okay, I tried it, but there are memory issues. It seems the memory
>consumption increases exponentially with every sphere that is added. Too many
>spheres and I crash. Here is my code:

Interesting.  Does the behaviour persist if you use #declare instead of
#local?

>#object{Obj}

What does #object do?

-- 
Ron Parker   http://www2.fwi.com/~parkerr/traces.html
My opinions.  Mine.  Not anyone else's.


Post a reply to this message

From: Chris Huff
Subject: Re: Stacking spheres - was Re: Patch enhancement request - Trace keyword
Date: 30 Jun 2000 16:41:46
Message: <chrishuff-336AFB.15415230062000@news.povray.org>
In article <395D0070.5525367B@aol.com>, STB### [at] aolcom wrote:

> Okay, I tried the idea, and it works, but pov crashes if I go through 
> 200 or more loops. Here is my code:

It might work better if you added the objects to an array intead of 
using a deeply nested union.
Oh, and why did you use "#object"?

-- 
Christopher James Huff - Personal e-mail: chr### [at] maccom
TAG(Technical Assistance Group) e-mail: chr### [at] tagpovrayorg
Personal Web page: http://homepage.mac.com/chrishuff/
TAG Web page: http://tag.povray.org/


Post a reply to this message

From: Ron Parker
Subject: Re: Patch enhancement request - Trace keyword
Date: 30 Jun 2000 16:42:14
Message: <slrn8lq27a.1u8.ron.parker@linux.parkerr.fwi.com>
On 30 Jun 2000 16:30:58 -0400, Ron Parker wrote:
>On Fri, 30 Jun 2000 13:10:02 -0700, SamuelT wrote:
>>Okay, I tried it, but there are memory issues. It seems the memory
>>consumption increases exponentially with every sphere that is added. Too many
>>spheres and I crash. Here is my code:
>
>Interesting.  Does the behaviour persist if you use #declare instead of
>#local?

By the way, I don't get this behavior when I run your code on MegaPOV 0.3.
It uses 160K per 100 iterations of the loop, plus about 80K standing still,
I ran it for 1000 spheres with no problem; memory usage was 1670616 bytes.
It might be a bug in recent MegaPOVs.  I don't have one to test with.
-- 
Ron Parker   http://www2.fwi.com/~parkerr/traces.html
My opinions.  Mine.  Not anyone else's.


Post a reply to this message

From: Chris Huff
Subject: Re: Patch enhancement request - Trace keyword
Date: 30 Jun 2000 16:47:28
Message: <chrishuff-A5F4F3.15473430062000@news.povray.org>
In article <slr### [at] linuxparkerrfwicom>, 
ron### [at] povrayorg wrote:

> What does #object do?

It acts the same as "object" as far as I can tell...things like "#box" 
also work. It works in the official version too, I guess it is just a 
strange parser bug.

-- 
Christopher James Huff - Personal e-mail: chr### [at] maccom
TAG(Technical Assistance Group) e-mail: chr### [at] tagpovrayorg
Personal Web page: http://homepage.mac.com/chrishuff/
TAG Web page: http://tag.povray.org/


Post a reply to this message

From: Ron Parker
Subject: Re: Patch enhancement request - Trace keyword
Date: 30 Jun 2000 16:54:50
Message: <slrn8lq2uu.1vi.ron.parker@linux.parkerr.fwi.com>
On Fri, 30 Jun 2000 15:47:34 -0500, Chris Huff wrote:
>In article <slr### [at] linuxparkerrfwicom>, 
>ron### [at] povrayorg wrote:
>
>> What does #object do?
>
>It acts the same as "object" as far as I can tell...things like "#box" 
>also work. It works in the official version too, I guess it is just a 
>strange parser bug.

I looked it up.  The tokenizer just ungets anything that doesn't belong
after a # without raising any eyebrows.  You can even say

#declare #foo = 12;
#declare #bar = foo;

without any problems.  Nice for obfuscation, but not guaranteed to stay
that way.

-- 
Ron Parker   http://www2.fwi.com/~parkerr/traces.html
My opinions.  Mine.  Not anyone else's.


Post a reply to this message

Goto Latest 10 Messages Next 5 Messages >>>

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