![](/i/fill.gif) |
![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Hello, I need help using the trace function because it gives me some
small artifacts in the use I made.
I declare an object by a sphere then a loop three dimensions x, y and z
that will use a trace function to place a cube whenever she meets
predefined object (thus the sphere), which gives this :
# declare blocksize = size; // "blocksize" is the cubes dimension
# declare xx =-width / 2;
# while (xx <= width / 2)
# declare zz = (-depth / 2);
# while (zz <= depth / 2)
# declare yy = 0;
# while (yy <= height)
/ / I put a "pixel" (cube here) if detected object
# declare coord = <xx, yy, zz>;
# declare departure = <xx+0.01, yy+0.01, zz+0.01>;
# declare normal = <0.0, 0.0, 0.0>;
# declare key = trace (ball, coord, depart.gray, normal); // It
seems like .gray gives better results here...
# if (touche.gray)
box {- (blocksize / 2), (blocksize / 2) scale 0.8 translate <xx,
yy, zz> pigment {rgb 0.8 + (rand (random * zz * 0.2))} finish {ambient 0.0}}
# end
# declare yy yy + = blocksize;
# end
# declare zz zz + = blocksize;
# end
# declare xx = xx + blocksize;
# end
and produces the image with the sphere which seems to be "pixelated" but
if I have the misfortune to want to apply this function to a single
union (two spheres and a cylinder type alters old) that drool a little
in the way of a blob ... spheres seem to spill over into the cylinder as
if they melted!
What do you think? How can I fix this?
Thank you for your help.
Post a reply to this message
Attachments:
Download 'image00.jpg' (71 KB)
Download 'image01.jpg' (49 KB)
Preview of image 'image00.jpg'
![image00.jpg](/povray.advanced-users/attachment/%3C51bde7c9%40news.povray.org%3E/image00.jpg?ttop=443814&toff=350&preview=1)
Preview of image 'image01.jpg'
![image01.jpg](/povray.advanced-users/attachment/%3C51bde7c9%40news.povray.org%3E/image01.jpg?ttop=443814&toff=350&preview=1)
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Opps, I put the images here, sorry :(
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
I'm not quite sure what you are testing, because touche.gray
is not one of the variables you are actually using in trace.
I assume that is a copy and post issue.
But, you may be misunderstanding the direction
("departure") vector and the trace result.
1. This is not a line segment intersection test. The length
is irrelevant. If it hits anything in the direction it points
to it will return something. So you should paint the boxes where
the surface is hit (trace result), not at the coordinate you
start out testing.
2. As it is a direction you do not need to define the vector
relative to the coordinate. If you want it to point 45° away
you use <1,1,1>. If you want it to point inward to the origin
you could use -<xx,yy,zz>.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Le 17/06/2013 02:39, Christian Froeschlin a écrit :
> I'm not quite sure what you are testing, because touche.gray
> is not one of the variables you are actually using in trace.
> I assume that is a copy and post issue.
>
> But, you may be misunderstanding the direction
> ("departure") vector and the trace result.
>
> 1. This is not a line segment intersection test. The length
> is irrelevant. If it hits anything in the direction it points
> to it will return something. So you should paint the boxes where
> the surface is hit (trace result), not at the coordinate you
> start out testing.
>
> 2. As it is a direction you do not need to define the vector
> relative to the coordinate. If you want it to point 45° away
> you use <1,1,1>. If you want it to point inward to the origin
> you could use -<xx,yy,zz>.
>
Ok, I'll try, thank you.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
See if this helps any.
http://news.povray.org/web.51f61e827603294573fc9ebb0%40news.povray.org
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |