POV-Ray : Newsgroups : povray.binaries.images : something for ya... : Re: something for ya... Server Time
20 Nov 2024 00:36:14 EST (-0500)
  Re: something for ya...  
From: Dan Byers
Date: 23 Oct 2001 19:58:12
Message: <B7FB6F1F.A6B%goofygrafx@aol.com>
> From: "Mahalis" <don### [at] fakeycom>
> Newsgroups: povray.binaries.images
> Date: Tue, 23 Oct 2001 19:30:19 -0400
> Subject: Re: something for ya...
> 
> Kewl- nice lighting, excellent textures, yada yada... :-) How'd you do the
> domino floor?

here's the source (or part of it anyways):
//--------------------- source starts here
#declare boxWide = 5;
#declare boxTall = .5;
#declare cutOutWide = boxWide*.85;
#declare cutOutThick = boxTall*.25;
#local theHole = boxWide*.5;
 
#declare cutOut =
union {
    cylinder { x* cutOutWide, -x* cutOutWide, cutOutThick }
    sphere { x* cutOutWide, cutOutThick }
    translate y*boxTall
}

#declare One = 
torus { cutOutWide*.25, cutOutThick translate y*boxTall }

#declare Two = 
union {
    torus { cutOutWide*.25, cutOutThick translate <theHole,boxTall,theHole>
}    
    torus { cutOutWide*.25, cutOutThick translate
<-theHole,boxTall,-theHole> }
}

#declare Three = 
union {
    torus { cutOutWide*.25, cutOutThick translate <theHole,boxTall,theHole>
}    
    torus { cutOutWide*.25, cutOutThick translate
<-theHole,boxTall,-theHole> }
    torus { cutOutWide*.25, cutOutThick translate y*boxTall }
}

#declare Four = 
union {
    torus { cutOutWide*.25, cutOutThick translate <theHole,boxTall,theHole>
}    
    torus { cutOutWide*.25, cutOutThick translate
<-theHole,boxTall,-theHole> }
    torus { cutOutWide*.25, cutOutThick translate <-theHole,boxTall,theHole>
}    
    torus { cutOutWide*.25, cutOutThick translate <theHole,boxTall,-theHole>
}    
}

#declare Five = 
union {
    torus { cutOutWide*.25, cutOutThick translate <theHole,boxTall,theHole>
}    
    torus { cutOutWide*.25, cutOutThick translate
<-theHole,boxTall,-theHole> }
    torus { cutOutWide*.25, cutOutThick translate <-theHole,boxTall,theHole>
}    
    torus { cutOutWide*.25, cutOutThick translate <theHole,boxTall,-theHole>
}    
    torus { cutOutWide*.25, cutOutThick translate y*boxTall }
}

#declare Six = 
union {
    torus { cutOutWide*.25, cutOutThick translate <theHole,boxTall,theHole>
}    
    torus { cutOutWide*.25, cutOutThick translate
<-theHole,boxTall,-theHole> }
    torus { cutOutWide*.25, cutOutThick translate <-theHole,boxTall,theHole>
}    
    torus { cutOutWide*.25, cutOutThick translate <theHole,boxTall,-theHole>
}    
    torus { cutOutWide*.25, cutOutThick translate <theHole,boxTall,0> }
    torus { cutOutWide*.25, cutOutThick translate <-theHole,boxTall,0> }
}

#macro myBox() 
difference {
    box {
        <-boxWide,-boxTall,-boxWide >,< boxWide,boxTall,boxWide >
    }
    object { cutOut translate z* cutOutWide }
    object { cutOut translate z* cutOutWide rotate y*90 }
    object { cutOut translate z* cutOutWide rotate y*180}
    object { cutOut translate z* cutOutWide rotate y*270}
    #local flag = int(rand( seed13 )*6);
    #switch( flag )
        #case( 0 )
        object { One }
        #break
        #case( 1 )
        object { Two }
        #break
        #case( 2 )
        object { Three }
        #break
        #case( 3 )
        object { Four }
        #break
        #case( 4 )
        object { Five }
        #break
        #case( 5 )
        object { Six }
        #break
    #end
}
#end
//------------------------------ source ends here

... not the super-science way of doing things, but what the hell... :)

-- 
dan
http://hometown.aol.com/goofygrafx


Post a reply to this message

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