POV-Ray : Newsgroups : povray.general : Can't Figure out trace() Server Time
7 Nov 2024 07:31:56 EST (-0500)
  Can't Figure out trace() (Message 1 to 6 of 6)  
From: How Camp
Subject: Can't Figure out trace()
Date: 5 Apr 2002 19:12:53
Message: <3cae3d85@news.povray.org>
Hmm.  I don't seem to understand how to use trace() correctly.  Being a
dutiful user, I went back to the manual, and found a nifty example involving
a simple sphere and a cylinder.  It works great...

...unless I translate the sphere around.  Then, trace() tends to return
results based on where the object was #defined, not where it actually sits
in the scene.  Multiple placements of the object don't seem to get hit,
either as I would (incorrectly?) expect them to.

For example, if I #declare MySphere at the origin, and then place it in my
scene via object{MySphere translate <3,3,3>}, my use of trace() seems to
return results as if the sphere were actually sitting at the origin instead
of at my translated position.

Help!  What am I doing wrong?

- How


Post a reply to this message

From:
Subject: Re: Can't Figure out trace()
Date: 5 Apr 2002 19:18:49
Message: <lifsau8rnnp34sapm2j5cdiu5nmeqlvia2@4ax.com>
On Fri, 5 Apr 2002 18:12:23 -0600, "How Camp" <kro### [at] hotmailcom> wrote:
> Help!  What am I doing wrong?

As I understand You are making something like this (in shortcut):

#local MySphere=sphere{ Center Radius }
object{MySphere translate <3,3,3>}
#local Intersection = trace( MySphere , ...);

while you should do rather:

#local MySphere=sphere{ Center Radius }
#local MyNewSphere=object{MySphere translate <3,3,3>}
#local Intersection = trace( MyNewSphere , ...);

ABX


Post a reply to this message

From: Anders K 
Subject: Re: Can't Figure out trace()
Date: 5 Apr 2002 19:47:59
Message: <3cae45bf$1@news.povray.org>
> Then, trace() tends to return
> results based on where the object was #defined, not where it actually sits
> in the scene.

That's because trace() tends to return results based on where the object was
#defined, not where it actually sits in the scene. :-)

Anders


Post a reply to this message

From: Christopher James Huff
Subject: Re: Can't Figure out trace()
Date: 5 Apr 2002 21:20:42
Message: <chrishuff-14CA9A.21220405042002@netplex.aussie.org>
In article <3cae3d85@news.povray.org>,
 "How Camp" <kro### [at] hotmailcom> wrote:

> Hmm.  I don't seem to understand how to use trace() correctly.  Being a
> dutiful user, I went back to the manual, and found a nifty example involving
> a simple sphere and a cylinder.  It works great...
> 
> ...unless I translate the sphere around.  Then, trace() tends to return
> results based on where the object was #defined, not where it actually sits
> in the scene.  Multiple placements of the object don't seem to get hit,
> either as I would (incorrectly?) expect them to.
> 
> For example, if I #declare MySphere at the origin, and then place it in my
> scene via object{MySphere translate <3,3,3>}, my use of trace() seems to
> return results as if the sphere were actually sitting at the origin instead
> of at my translated position.

The trace() function only traces against the shape you give it. By 
declaring it and then using "object{MySphere translate <3,3,3>}" you are 
putting a copy of it into the scene and translating the copy...trace() 
knows nothing about this and only tests the version you passed to it.
If you want to test multiple objects, you need to put them in a union 
and pass that union to the trace() function.

-- 
Christopher James Huff <chr### [at] maccom>
POV-Ray TAG e-mail: chr### [at] tagpovrayorg
TAG web site: http://tag.povray.org/


Post a reply to this message

From: How Camp
Subject: Re: Can't Figure out trace()
Date: 5 Apr 2002 21:52:50
Message: <3cae6302@news.povray.org>
"Christopher James Huff" <chr### [at] maccom> wrote in message
news:chr### [at] netplexaussieorg...

> The trace() function only traces against the shape you give it. By
> declaring it and then using "object{MySphere translate <3,3,3>}" you are
> putting a copy of it into the scene and translating the copy...trace()
> knows nothing about this and only tests the version you passed to it.
> If you want to test multiple objects, you need to put them in a union
> and pass that union to the trace() function.

Ah, thank you all.  This makes much more sense.  And, of course, it works
beautifully.

- How


Post a reply to this message

From: Marc Jacquier
Subject: Re: Can't Figure out trace()
Date: 6 Apr 2002 07:23:11
Message: <3caee8af@news.povray.org>
I use trace that way:
I use it on my_object BEFORE transformation
I group my_object and object added by trace in a union object
THEN I apply any transformation to the union
Marc


Post a reply to this message

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