Forums

You may post here on any subjects related to this site or the software therein. (Most everything on this site is tied into the forums so that you may leave or post comments about it.)

   

Cat Condo B

   From: Lewis A. Sellers
   Date: January 12 1999 1:18 AM

Code:

//susy's cat condo B 1998
// lsellers@usit.net http://www.public.usit.net/~lsellers http://www.intrafoundation.com

#declare highquality=1; //0=fast low quality, 1=realistic computational expensive model/lighting (slow)


//
#declare T_LightWood =
texture {
pigment {
wood
color_map {
[0.0 color rgb<.85, .65, .51>]
[0.9 color rgb<.75, .50, .45>]
[1.0 color rgb<.55, .36, .34>]
}
turbulence 0.12
octaves 3
scale <0.05, .05, 1>
rotate <4,3,0>
}
finish {
diffuse 0.9
brilliance 1
specular .5
roughness .5
}
}
#declare T_BlueCarpet =
texture {
pigment {
color rgb<.5,.5,1>
}
normal {
quilted 1
turbulence 0.4
}
normal {
granite .1
turbulence 0
}
finish {
diffuse 0.9
brilliance .5
}
scale .1
}



camera {
location <0,2.5,-2.5>
look_at <0,1,0>
angle 60
}

light_source { <4,5,-6> color rgb<1,1,1> }


background { color rgb<.94,.819,.61> }


//catcondo 1.2d 1.9h .9hole
//susy's cat condo by lewis sellers 1.2d 1.9h .9hole
#declare catcondo = union {
difference {
cylinder {<0,0,0>,<0,1.9,0>, .6}

cylinder {<0,1.8,0>,<0,1.91,0>, .5} //top
cylinder {<0,.2,0>,<0,1.7,0>, .5 texture{T_LightWood}} //cavity
cylinder {<0,-.01,0>,<0,.1,0>, .5 texture{T_LightWood}} //bottom

cylinder {<0,.55,-2>,<0,.55,0>, .325} //bottom hole
cylinder {<0,1.35,-2>,<0,1.35,0>, .325} //upper hole
}
intersection { //make ledge
box {<-1,.9,-1>,<1,1.0,0>}
cylinder {<0,.2,0>,<0,1.7,0>, .5} //cavity
}

#ifdef (highquality)
//start seed
#declare s=seed(131);

// the main exterior minus cat holes. dist=sqr( (x1-x0)2 + (y1-y0)2 )
#declare obs=0;
#while (obs <= pi*2)

//speed optimization by cache
#declare cx=cos(obs)*.6;
#declare cz=sin(obs)*.6;
#declare cx2=cos(obs)*.63;
#declare cz2=sin(obs)*.63;

#declare oby=0;
#while (oby <= 1.9)

#declare justdoit=1;

#if (oby>.225 & oby<.875)
#declare l=vlength(<cx,oby-.55,cz-(-.6)>);
#if(l<.325)
#declare justdoit=0;
#end
#end

#if (oby>1.025 & oby<1.675)
#declare l=vlength(<cx,oby-1.35,cz-(-.6)>);
#if(l<.325)
#declare justdoit=0;
#end
#end

#if (justdoit=1)
cylinder { <cx,oby,cz>, <cx2+(rand(s)*.01),oby+(rand(s)*.025),cz2+(rand(s)*.01)>, .01 }
#end

#declare oby=oby+.0125;
#end

#declare obs=obs+pi/128;
#end

// inner flat top
#declare obx=0;
#declare obs_i=0;
#declare cc=0;
#while (obx <= .5)
#declare obs=0;
#declare cc=cc+1;
#declare obs_i=obs_i+1; //variable density
#while (obs <= pi*2)
cylinder { <cos(obs)*obx,1.8,sin(obs)*obx>, <cos(obs)*obx+(rand(s)*.01),1.83,sin(obs)*obx+(rand(s)*.01)>, .01 }
#declare obs=obs+pi/obs_i;
#end
#declare obx=obx+.0125;
#end

// outer flat top
#declare obx=.5;
#while (obx <= .6)
#declare obs=0;
#while (obs <= pi*2)
cylinder { <cos(obs)*obx,1.9,sin(obs)*obx>, <cos(obs)*obx+(rand(s)*.01),1.93,sin(obs)*obx+(rand(s)*.01)>, .01 }
#declare obs=obs+pi/128;
#end
#declare obx=obx+.0125;
#end

// top inner horiz ring
#declare oby=1.8;
#while (oby <= 1.9)
#declare obs=0;
#while (obs <= pi*2)
cylinder { <cos(obs)*.5,oby,sin(obs)*.5>, <cos(obs)*.47+(rand(s)*.01),oby+(rand(s)*.025),sin(obs)*.47+(rand(s)*.01)>, .01 }
#declare obs=obs+pi/128;
#end
#declare oby=oby+.0125;
#end

// ledge
#declare obx=0;
#declare obs_i=0;
#declare cc=0;
#while (obx <= .5)
#declare obs=pi;
#declare cc=cc+1;
#declare obs_i=obs_i+1; //variable density
#while (obs <= pi*2)
cylinder { <cos(obs)*obx,1,sin(obs)*obx>, <cos(obs)*obx+(rand(s)*.01),1.03,sin(obs)*obx+(rand(s)*.01)>, .01 }
#declare obs=obs+pi/obs_i;
#end
#declare obx=obx+.0125;
#end

// bottom cat hole <0,.55,-.6> .325
#declare obs=0;
#while (obs <= pi*2)
#declare obz=-.60;

#declare cx=cos(obs)*.325; //cache x base
#declare cy=sin(obs)*.325+0.55; //cache y base
#declare cx2=cos(obs)*.295; //cache x2 base
#declare cy2=sin(obs)*.295+0.55; //cache y2 base

#while (obz <= -.50)
#declare obz_m=obz+abs(cos(obs)*.1)+.001; //cutting the cat hole into a cylinder doesn't give a perfect ring. must mod depth
#declare obz=obz+.0125;
cylinder { <cx, cy, obz_m>, <cx2+(rand(s)*.01), cy2+(rand(s)*.01), obz_m+(rand(s)*.025)>, .01}
#end

#declare obs=obs+pi/128;
#end

// top cat hole <0,1.35,-.6> .325
#declare obs=0;
#while (obs <= pi*2)
#declare obz=-.60;

//speed optimization by caching
#declare cx=cos(obs)*.325; //cache x base
#declare cy=sin(obs)*.325+1.35; //cache y base
#declare cx2=cos(obs)*.295; //cache x2 base
#declare cy2=sin(obs)*.295+1.35; //cache y2 base

#while (obz <= -.50)
#declare obz_m=obz+abs(cos(obs)*.1)+.001; //cutting the cat hole into a cylinder doesn't give a perfect ring. must mod depth
#declare obz=obz+.0125;
cylinder { <cx, cy, obz_m>, <cx2+(rand(s)*.01), cy2+(rand(s)*.01), obz_m+(rand(s)*.025)>, .01}
#end

#declare obs=obs+pi/128;
#end
#end

texture {T_BlueCarpet}
}


object{catcondo rotate<0,0,0> translate<0,0,0> }
views 346
Copyright © 1997-2006 by Lewis A. Sellers.        Login