|
|
thank you all, i got something working yesterday, this is my code:
//------------------macro---------------------
#macro Recurse(currentlevel, currentscale)
object{ box{ <-50,0,-50> <50,10,50> pigment{ rgb 1}} scale
<1/currentscale,1,1/currentscale> pigment{ rgb 1 } }
#if (currentlevel<recursionmax)
union{
Recurse(currentlevel+1, currentscale*scalemultiplier)
translate
<-50/(currentscale*scalemultiplier),0,-50/(currentscale*scalemultiplier)>
translate <50/currentscale,10/currentscale,50/currentscale>
}
union{
Recurse(currentlevel+1, currentscale*scalemultiplier)
translate
<50/(currentscale*scalemultiplier),0,-50/(currentscale*scalemultiplier)>
translate <-50/currentscale,10/currentscale,50/currentscale>
}
union{
Recurse(currentlevel+1, currentscale*scalemultiplier)
translate
<-50/(currentscale*scalemultiplier),0,50/(currentscale*scalemultiplier)>
translate <50/currentscale,10/currentscale,-50/currentscale>
}
union{
Recurse(currentlevel+1, currentscale*scalemultiplier)
translate
<50/(currentscale*scalemultiplier),0,50/(currentscale*scalemultiplier)>
translate <-50/currentscale,10/currentscale,-50/currentscale>
}
#end
#end
//----------calling the macro----------
#declare scalemultiplier=3;
#declare recursionmax=4;
Recurse(0,1)
//-------------end of code-------------
now i am looking to do something like recursion into recurion (my mind is
getting twisted though)
i hope i can come up with the scene i have in mind soon.
regards, lenx (still breaking his head on the
mouse-has-to-find-cheese-in-a-maze problem in java)
Post a reply to this message
|
|