POV-Ray : Newsgroups : povray.advanced-users : Light Bright : Light Bright Server Time
29 Jul 2024 00:34:42 EDT (-0400)
  Light Bright  
From: David Wallace
Date: 15 Jul 2003 15:51:28
Message: <3f145b40$1@news.povray.org>
I want to make the lit bulbs in this readout display stand out from the
rest.  How do I pull it off?

#declare acolTable = array[6] {
 <0.00, 1.00, 0.00>,
 <0.75, 1.00, 0.00>,
 <1.00, 1.00, 0.00>,
 <1.00, 0.75, 0.00>,
 <1.00, 0.00, 0.00>,
 <0.00, 0.00, 1.00>
}

#macro otrLight(col, rad, active)
 #if (active)
  light_source {
   0, 1
   fade_distance 1
   fade_power 1.7
   looks_like { sphere { 0, rad
    hollow
    pigment { rgb col filter 1 }
    finish { ambient 1 }
   } }
  }
 #else
  sphere { 0, rad
   hollow
   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(9515);

#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


Post a reply to this message

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