POV-Ray : Newsgroups : povray.newusers : negative objects : Re: negative objects Server Time
5 Nov 2024 03:20:06 EST (-0500)
  Re: negative objects  
From: Gilles Tran
Date: 4 Nov 2000 05:06:31
Message: <3A03DF94.6551A46F@inapg.inra.fr>
Bill Brehm wrote:

> I'd like to create an compound object that adds something to the scene, but
> also removes something else from whatever it happens to intersect.

Like Steve said, there's no direct way to do this. However, you can make it a
little simpler by using an array.
#declare n=20;
#declare Pos=array[n]
#declare Pos[0]=<10,0,10>;
#declare Pos[1]=<14,0,11>;
...

#declare GolfBall=sphere{0,1}
//Then run a loop to put the golf balls
#declare i=0;#while (i<n) object{GolfBall translate Pos[i]} #declare i=i+1; #end

//and then another loop to make the ground
difference{
    plane{y,0}
    #declare i=0;#while (i<n) object{GolfBall scale 1.1 translate Pos[i]}
#declare i=i+1; #end
}

G.


Post a reply to this message

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