POV-Ray : Newsgroups : povray.advanced-users : trace functiuon help ! : trace functiuon help ! Server Time
12 Jun 2024 00:02:29 EDT (-0400)
  trace functiuon help !  
From: Lightbeam
Date: 16 Jun 2013 12:28:57
Message: <51bde7c9@news.povray.org>
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

Preview of image 'image01.jpg'
image01.jpg


 

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