Archive for the ‘Computer Graphics’ Category

Cat Condo.

Monday, November 26th, 2001

Date: November 26 2001 06:11 AM

A povray 3.1 model of a blue cat condo.

My cats made me put their favorite objects up here: The catcondo with fully articulated carpeting is a favorite as it took several hours to work out the math to mesh all the carpet fibers around the object. And yes, the fibers are all seperate objects.

Code:

///catcondo.pov
// 1024×768 AA 0.3 for computer speed comparisons
//susy’s cat condo 1998
// lsellers@usit.net http://www.public.usit.net/~lsellers http://www.intrafoundation.com
// 2001 nov. tweaked slightly under povray 3.5beta7

#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>
look_at   <.5,1,0>
angle 60
}

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

#if (highquality=1)
media { scattering { 3 rgb<.1,.1,.1> }}
#end

plane {
y, 0
pigment { checker pigment{ rgb<1,1,1>}, pigment{ rgb<0,0,0>} }
scale .5
finish { reflection 0 }
hollow
}
plane {
z, 4
pigment { checker pigment{ rgb<1,1,1>}, pigment{ rgb<0,0,0>} }
scale .5
finish { reflection 0 }
hollow
}

//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
}

#if (highquality=1)
//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> }

/*
#declare c=0
#declare py=-10
#while (py < 10)
#declare px=-10
#while (px < 10)
object{catcondo rotate<0,degrees(cos(c)),0> translate<px,0,py> }
#declare c=c+pi/10
#declare px=px+2
#end
#declare py=py+2
#end
*/

Rocking Chairs

Monday, October 12th, 1998

Date: October 12 1998 09:12 PM

// cat tail rocker by Lewis Sellers, 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)

// define textures
#declare T_HardWood =
texture {
pigment {
wood
color_map {
[0.0 color rgb<.75, .55, .41>]
[0.9 color rgb<.65, .40, .35>]
[1.0 color rgb<.45, .26, .24>]
}
turbulence 0.3
octaves 3
scale <0.05,.05,1>
rotate <8,4,2>
}
finish {
diffuse 0.9
reflection 0.1
brilliance 1
specular .5
roughness .5
}
}

#declare T_OakWood =
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
//reflection 0.1
brilliance 1
specular .5
roughness .5
}
}

#declare T_SmoothOakWood =
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 1.0
reflection 0.2
brilliance 1
specular .6
roughness .1
}
}

#declare T_Stucco =
texture {
pigment {
wrinkles
color_map {
[0.0 color rgb<.7,.7,.7>]
[0.9 color rgb<.6,.6,.6>]
[1.0 color rgb<.4,.4,.4>]
}
turbulence 0.3
octaves 3
scale <1,1,1>
rotate <8,4,2>
}
finish {
diffuse 0.9
}
}

//the simple room
//floor
box {<-10,-1,-10>,<5,0,4> texture {T_HardWood} }
//the walls
box {<-11,-1,3>,<5,8,4> texture {T_Stucco} }
box {<-10,-1,3>,<-11,8,-17> texture {T_Stucco} }

//rocking chair. all struts are .05w slats are .2w
#declare rc_rearpost = lathe {
linear_spline
9,
<0,0>, <.05,0>, <.1,.5>, <.1,4.7>, <.05,4.8>, <.1,4.9>, <.1,5.1>, <.05,5.15>, <0,5.2>
texture{T_OakWood rotate<90,90,0>}
}
#declare rc_forepost = lathe {
linear_spline
6,
<0,0>, <.05,0>, <.1,.5>, <.1,2.25>, <.05,2.5>, <0,2.5>
texture{T_OakWood rotate<90,90,0>}
}
#declare rc_slat =
box { //slat n
<-.1,2.2,.97>,<.1,4.0,1.03>
texture{T_OakWood rotate<90,90,0>}
}
#declare rc_seatslat =
difference {
box {<-.09,0,-.93>,<.09,.1,.93>}
box {<-.1,0,0>,<.1,.1,.5> rotate<-15,0,0> translate<0,0,-.93>}
texture{T_SmoothOakWood}
}

#declare rc_leftarm = union {
difference {
box {<-.2,0,0>,<.1,.1,2.4>}
box {<-.21,-.1,1>,<-.1,.2,2.6>}
cylinder {<-.15,-.11,1>,<-.15,.11,1>,.05}
}
cylinder {<-.05,0,0>,<-.05,.1,0>,.15}
texture{T_SmoothOakWood}
}
#declare rc_rightarm = union {
difference {
box {<.2,0,0>,<-.1,.1,2.4>}
box {<.21,-.1,1>,<.1,.2,2.6>}
cylinder {<.15,-.11,1>,<.15,.11,1>,.05}
}
cylinder {<.05,0,0>,<.05,.1,0>,.15}
texture{T_SmoothOakWood}
}
#declare rc_roundbrace =
intersection {
difference {
cylinder {<0,0,-.05>,<0,0,.05>,2.1}
cylinder {<0,0,-.06>,<0,0,.06>,2.0}
translate<0,2.1,0>
}
box {<-1,-1,-.2>,<1,1,.2> rotate<0,0,45>}
}
#declare rc_rocker = union {
intersection {
difference {
cylinder {<0,0,-.05>,<0,0,.05>,2.1}
cylinder {<0,0,-.06>,<0,0,.06>,2.0}
translate<0,2.1,0>
}
box {<-1.75,-1.75,-.2>,<1.75,1.75,.2> rotate<0,0,45>}
}
rotate<0,90,0>
}
#declare rockingchair = union {
union {
//rear
object {rc_rearpost translate<-.9,0,1>}
object {rc_rearpost translate<.9,0,1>}

//fore
object {rc_forepost translate<-.9,0,-1>}
object {rc_forepost translate<.9,0,-1>}

//struts
cylinder {<-.9,.5,-1>,<.9,.5,-1>,.05} //low fore
cylinder {<-.9,1.5,-1>,<.9,1.5,-1>,.05} //high fore
cylinder {<-.9,1,1>,<-.9,1,-1>,.05} //left
cylinder {<.9,1,1>,<.9,1,-1>,.05} //right

//seat
//box {<-.9,1.6,-1>,<.9,1.7,1>}
object {rc_seatslat rotate<0,0,-20> translate<-.8,1.6+.20,0>}
object {rc_seatslat rotate<0,0,-15> translate<-.6,1.6+.13,0>}
object {rc_seatslat rotate<0,0,-10> translate<-.4,1.6+.07,0>}
object {rc_seatslat rotate<0,0,-5> translate<-.2,1.6+.05,0>}
object {rc_seatslat rotate<0,0,0> translate<0,1.6+0,0>}
object {rc_seatslat rotate<0,0,5> translate<.2,1.6+.05,0>}
object {rc_seatslat rotate<0,0,10> translate<.4,1.6+.07,0>}
object {rc_seatslat rotate<0,0,15> translate<.6,1.6+.13,0>}
object {rc_seatslat rotate<0,0,20> translate<.8,1.6+.20,0>}

//back lattice
box {<-.8,4.0,.95>,<.8,4.1,1.05>} //top
object {rc_slat translate<-.5,0,0>}
object {rc_slat translate<-.2,0,0>}
object {rc_slat translate<.2,0,0>}
object {rc_slat translate<.5,0,0>}
box {<-.8,2.1,.95>,<.8,2.2,1.05>} //bottom

//back head board
difference {
cylinder {<-.8,4.5,1>,<.8,4.5,1>,.2}
box {<-.85,4.2,.9>,<.85,4.8,.7>}
box {<-.85,4.2,1.1>,<.85,4.8,1.3>}
}

//left arm
object {rc_leftarm translate<-.9,2.5,-1.5>}

//right arm
object {rc_rightarm translate<.9,2.5,-1.5>}

//back brace
object {rc_roundbrace translate<0,1.5,-.9>}

//fore brace
object {rc_roundbrace translate<0,1.5,.9>}

rotate<0,0,0>
translate<0,.3,0>
}
//rockers
object {rc_rocker translate<-.9,0,0>}
object {rc_rocker translate<.9,0,0>}

texture {T_OakWood}
}

//ok. put the chairs on the floor
object{rockingchair rotate<0,0,0> translate<0,0,0> }
object{rockingchair rotate<0,-42,0> translate<-5,0,0> }
//object{rockingchair rotate<-90,45,0> translate<-2,1,-2> }
//object{rockingchair rotate<0,-45,0> translate<3,0,0>}

//our lighting…. we have two choices

//this renders quickly
#if (highquality=0)
light_source { <5,5,-5> color rgb<1,1,1> fade_distance 5}
#end

//this renders slowly, but looks much better
#if (highquality=1)
light_source { <10,10,-9.5>, color rgb<1,.99,.9> area_light x*6,y*6,3,3 jitter fade_distance 5}
//media { scattering { 3 rgb<.1,.1,.1> }}
#end

camera {
//    location <2,4,-1>
//    look_at  <0,2.5,-1>

//    location <2,4,-1>
//    look_at  <0,2.5,0>

//    location <.5,3,-1>
//    look_at  <0,2.5,0>

location  <3, 4, -6>
look_at   <-.5, 2.5, 0>

//location  <11, 11, -6>
//look_at   <-.5, 2.5, 0>
}

CGI Images 1998

Thursday, January 1st, 1998

The following are a few CGI made in 1998. click the image to see it in higher resolution.