POV-Ray : Newsgroups : povray.general : trace() position imprecise Server Time
1 Nov 2024 13:21:35 EDT (-0400)
  trace() position imprecise (Message 1 to 3 of 3)  
From: jkroby
Subject: trace() position imprecise
Date: 11 Nov 2011 03:55:00
Message: <web.4ebce2923444898e38b76eca0@news.povray.org>
Hi,
I am trying to regenerate a 3D mesh with intersecting planes of the mesh and
then the son-splines, that's all ok, the problem is in some intersections
between the sides of the triangles of the mesh with the plans, sometimes all
right at times there is a error of the calculation of the position, I pulled
some data to be sure that there were no changes or translations.
From the image we can see the problem, the 2-ball should be on 2 segments but
are elsewhere, there is some setting that are clueless?
Does anyone have ideas?
I have tested the code whith 3.6 and 3.7

Image http://www.p3r.info/povray/test1.jpg

File for making the test:

global_settings {
   adc_bailout 3.9216e-05
   assumed_gamma 1.5
   max_trace_level 20
   noise_generator 2
}
//*PMRawBegin

#declare pl=plane{
y, 7.6
pigment{ color <1,0,0>}
}
pl
#declare p1=<0.3263,7.5234,0.5864>;
#declare p2=<0.3258,7.6827,0.4441>;
#declare p3=<0.2471,7.6968,0.4954>;
#declare c1=pigment{ color <0,1,0> }
#declare c2=pigment{ color <0,0,1> }
#declare c2a=pigment{ color <0,0.5,1> }
#declare c3=pigment{ color <0,1,1> }
cylinder{ p1,p2, 0.005 pigment{ c3 } }
cylinder{ p1,p3, 0.005 pigment{ c3 } }
sphere{ p1, 0.01 pigment{ c1 } }
sphere{ p2, 0.01 pigment{ c1 } }
sphere{ p3, 0.01 pigment{ c1 } }
sphere{ trace(pl,p1,p2), 0.01 pigment{ c2 } }
sphere{ trace(pl,p1,p3), 0.01 pigment{ c2a } }
//*PMRawEnd

light_source {
   <0.0535041, 8.53804, 1.97729>, rgb <1, 1, 1>
}

camera {
   perspective
   location <0.324006, 7.76436, 0.895641>
   sky <0, 1, 0>
   direction <0, 0, 1>
   right <1.33333, 0, 0>
   up <0, 1, 0>
   look_at <0.32028, 7.59371, 0.581751>
}


Post a reply to this message

From: clipka
Subject: Re: trace() position imprecise
Date: 11 Nov 2011 07:41:10
Message: <4ebd17e6$1@news.povray.org>
Am 11.11.2011 09:53, schrieb jkroby:
>  From the image we can see the problem, the 2-ball should be on 2 segments but
> are elsewhere, there is some setting that are clueless?
> Does anyone have ideas?

Yes: Note that the trace() function does not expect a point as the third 
parameter, but a direction. Thus, to achieve the desired results, you 
should replace:

> sphere{ trace(pl,p1,p2), 0.01 pigment{ c2 } }
> sphere{ trace(pl,p1,p3), 0.01 pigment{ c2a } }

with:

sphere{ trace(pl,p1,p2-p1), 0.01 pigment{ c2 } }
sphere{ trace(pl,p1,p3-p1), 0.01 pigment{ c2a } }


Post a reply to this message

From: jkroby
Subject: Re: trace() position imprecise
Date: 12 Nov 2011 05:20:01
Message: <web.4ebe47d680b5aa3338b76eca0@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> Am 11.11.2011 09:53, schrieb jkroby:
> >  From the image we can see the problem, the 2-ball should be on 2 segments but
> > are elsewhere, there is some setting that are clueless?
> > Does anyone have ideas?
>
> Yes: Note that the trace() function does not expect a point as the third
> parameter, but a direction. Thus, to achieve the desired results, you
> should replace:
>
> > sphere{ trace(pl,p1,p2), 0.01 pigment{ c2 } }
> > sphere{ trace(pl,p1,p3), 0.01 pigment{ c2a } }
>
> with:
>
> sphere{ trace(pl,p1,p2-p1), 0.01 pigment{ c2 } }
> sphere{ trace(pl,p1,p3-p1), 0.01 pigment{ c2a } }

Thank you very much, just a dumb mistake!
Roberto


Post a reply to this message

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