|
|
#declare otrDim = <0.25, 0.02, 0.15>;
#declare otrPos = <0.00, 0.35, 0.55>;
#declare otrRis = 0.15;
#macro otrLight(col, rad, active)
#if (active)
union {
sphere { 0, rad material { matBulb } }
light_source {
0, col*.3
fade_distance 1
fade_power 1.75
glow {
radius rad*.9
fade_power 2
}
}
}
#else
sphere { 0, rad texture { pigment { rgb col filter 1 } } }
#end
#end
#macro otrLights(pos) union {
#local siz = (otrDim.x-0.02)*.070;
#local sep = siz*2.2;
#local orig = -sep*2.5;
#local ps = 0;
#while (ps<6)
object {
otrLight( acolTable[ps], siz, (ps=pos) )
translate x*(orig+ps*sep)
}
#set ps = ps + 1;
#end
} #end
#declare otrSeed = seed(9517);
#macro otsReadout() union {
#local bx1 = otrDim+y*otrRis;
#local bang = degrees(atan2(otrRis,otrDim.z));
intersection {
box { <-.5, 0, -.5>, <.5, 1, .5> scale bx1 }
plane { y, 0 rotate x*bang translate otrDim*<0, 1, 0.5> }
}
#local bstr = otrDim*<1,1,Pythag(1,otrRis/otrDim.z)>;
#local bhgt = otrDim.y+otrRis*0.5;
#local bcut = bstr-<0.02, 0, 0.02>;
difference {
box { <-.5, 0, -.5>, <.5, 1, .5> scale bstr }
box { <-.5, -.1, -.5>, <.5, 1.1, .5> scale bcut }
rotate x*bang
translate y*bhgt
}
#local sep = z*bcut*0.20;
#local orig = -sep*2.0;
#local ps = 0;
union {
#while (ps<5)
#local lps = int(rand(otrSeed)*6);
object { otrLights(lps) translate orig+sep*ps }
#set ps = ps + 1;
#end
rotate x*bang
translate y*bhgt
}
} #end
I find that the glows in otsReadout show up in the scene even when the
parent object that is supposed to contain them is omitted from the scene.
Its declaration,
#declare otScanner = union {
object { otsBody }
object { otsLens }
object { otsTray }
object { otsLamp translate <-0.09, otsDim.y,-0.10> rotate y*17 }
object { otsLamp translate <0.09, otsDim.y,-0.10> rotate -y*17 }
object { otsWheel translate otswPos }
object { otsGuard translate otswPos }
object { otsWheel translate otswPos scale <-1, 1, 1 > }
object { otsGuard translate otswPos scale <-1, 1, 1 > }
object { otsWheel translate otswPos scale < 1, 1,-1 > }
object { otsGuard translate otswPos scale < 1, 1,-1 > }
object { otsWheel translate otswPos scale <-1, 1,-1 > }
object { otsGuard translate otswPos scale <-1, 1,-1 > }
object { otsReadout() translate otrPos }
translate y*otswShift
}
seems to automatically insert them even when not instantiated. Why is this?
BTW, here it the body and lens. Just comment out what I did not include.
#declare otsDim = <0.50, 0.35, 1.26>;
#declare otsCut = <0.90, 0.35, 1.22>;
#declare otslRad = 0.20;
#declare otslSqu = 0.20;
#declare otsLens = sphere { 0, otslRad
scale <1, otslSqu, 1>
translate y*(otsDim.y-0.01)
material { matLens }
}
#declare otsBody = difference {
union {
box { <-.5, 0, -.5>, <0.5, 1, 0.5> scale otsDim }
cylinder { -z*otsDim, z*otsDim, otsDim.y translate x*otsDim scale <0.5, 1,
0.5> }
cylinder { -z*otsDim, z*otsDim, otsDim.y translate -x*otsDim scale <0.5,
1, 0.5> }
}
plane { y, 0 }
box { <-.5, 0, -.5>, <0.5, 1.0, 0.5> scale otsCut translate y*-.02 }
box { <-.4, 1.00,-0.47>, <0.4, 2.00,-0.23> scale otsDim translate y*-.01 }
cylinder { -z*otsDim.z*1.1, z*otsDim.z*1.1, otsDim.y*0.8 }
object { otsLens }
}
Post a reply to this message
|
|