POV-Ray : Newsgroups : povray.unofficial.patches : Permanent glows in MegaPov Server Time
1 Jun 2024 03:47:22 EDT (-0400)
  Permanent glows in MegaPov (Message 1 to 6 of 6)  
From: David Wallace
Subject: Permanent glows in MegaPov
Date: 17 Jul 2003 02:38:55
Message: <3f16447f@news.povray.org>
#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

From: Christopher James Huff
Subject: Re: Permanent glows in MegaPov
Date: 17 Jul 2003 19:49:35
Message: <cjameshuff-5A61D2.18471917072003@netplex.aussie.org>
In article <3f16447f@news.povray.org>,
 "David Wallace" <dar### [at] earthlinknet> wrote:

> 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.

In the current version of the patch, objects can not contain glows. 
You've specified the glows as usual, you just did it inside the object 
declaration.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From: David Wallace
Subject: Re: Permanent glows in MegaPov
Date: 18 Jul 2003 02:28:00
Message: <3f179370$1@news.povray.org>
"Christopher James Huff" <cja### [at] earthlinknet> wrote in message
news:cja### [at] netplexaussieorg...
> In article <3f16447f@news.povray.org>,
>  "David Wallace" <dar### [at] earthlinknet> wrote:
>
> > 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.
>
> In the current version of the patch, objects can not contain glows.
> You've specified the glows as usual, you just did it inside the object
> declaration.
>
> -- 
> Christopher James Huff <cja### [at] earthlinknet>
> http://home.earthlink.net/~cjameshuff/
> POV-Ray TAG: chr### [at] tagpovrayorg
> http://tag.povray.org/

Unfortunately, the glows have to be part of an object.  The readout display
is on a tray that is meant to roll from one end of a basin to another (macro
sets position).  The whole main object, a type of operating table with a
central drain in the basin, is meant to be replicated with differing
readouts (macro combined with random seed pulls this off).

The glows are meant to indicate which lights are on as I have yet to find a
better solution.  Media, either scattering or emitting, is useless.  The
lights are meant to be colored plastic bulbs (filter 1) that show up when
lit, but the light source has little if any effect on the surface.  Any
suggestions (code preferred)?


Post a reply to this message

From: Christopher James Huff
Subject: Re: Permanent glows in MegaPov
Date: 21 Jul 2003 11:16:05
Message: <cjameshuff-AA6815.10092521072003@netplex.aussie.org>
In article <3f179370$1@news.povray.org>,
 "David Wallace" <dar### [at] earthlinknet> wrote:

> Unfortunately, the glows have to be part of an object.  The readout display
> is on a tray that is meant to roll from one end of a basin to another (macro
> sets position).  The whole main object, a type of operating table with a
> central drain in the basin, is meant to be replicated with differing
> readouts (macro combined with random seed pulls this off).

Well, you can't have glows as part of an object (currently). However, 
you could use transformations to make them follow the object along. This 
takes a bit of a different construction method, but is possible...


> The glows are meant to indicate which lights are on as I have yet to find a
> better solution.  Media, either scattering or emitting, is useless.  The
> lights are meant to be colored plastic bulbs (filter 1) that show up when
> lit, but the light source has little if any effect on the surface.  Any
> suggestions (code preferred)?

Try small spheres with transparent textures and highlights, each with a 
light source inside. This method has its flaws, but is a cheap and quick 
way of doing a relatively small number of glows.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From: David Wallace
Subject: Re: Permanent glows in MegaPov
Date: 22 Jul 2003 05:52:00
Message: <3f1d0940@news.povray.org>
"Christopher James Huff" <cja### [at] earthlinknet> wrote in message
news:cja### [at] netplexaussieorg...
> In article <3f179370$1@news.povray.org>,
>  "David Wallace" <dar### [at] earthlinknet> wrote:
>
> > Unfortunately, the glows have to be part of an object.  The readout
display
> > is on a tray that is meant to roll from one end of a basin to another
(macro
> > sets position).  The whole main object, a type of operating table with a
> > central drain in the basin, is meant to be replicated with differing
> > readouts (macro combined with random seed pulls this off).
>
> Well, you can't have glows as part of an object (currently). However,
> you could use transformations to make them follow the object along. This
> takes a bit of a different construction method, but is possible...
>
>
> > The glows are meant to indicate which lights are on as I have yet to
find a
> > better solution.  Media, either scattering or emitting, is useless.  The
> > lights are meant to be colored plastic bulbs (filter 1) that show up
when
> > lit, but the light source has little if any effect on the surface.  Any
> > suggestions (code preferred)?
>
> Try small spheres with transparent textures and highlights, each with a
> light source inside. This method has its flaws, but is a cheap and quick
> way of doing a relatively small number of glows.
>
> -- 
> Christopher James Huff <cja### [at] earthlinknet>
> http://home.earthlink.net/~cjameshuff/
> POV-Ray TAG: chr### [at] tagpovrayorg
> http://tag.povray.org/
I tried that... the spheres don't light up enough to differentiate them from
those which are not lit.  All I see is the point of light in the middle.  I
need the whole bulb to light up.  A scattering media perhaps?


Post a reply to this message

From: Christopher James Huff
Subject: Re: Permanent glows in MegaPov
Date: 22 Jul 2003 11:06:15
Message: <cjameshuff-DB11D6.09591622072003@netplex.aussie.org>
In article <3f1d0940@news.povray.org>,
 "David Wallace" <dar### [at] earthlinknet> wrote:

> I tried that... the spheres don't light up enough to differentiate them from
> those which are not lit.  All I see is the point of light in the middle. 

Just adjust the settings to make a bigger highlight. For specular, use a 
larger value for roughness.


> I need the whole bulb to light up.  A scattering media perhaps?

Scattering media is overkill for just lighting a small indicator, though 
it will work for simulating the glow effect around the light. You could 
fill the light with emitting media, which may actually be faster than 
the light source method if you have lots of lights. If you don't put a 
light source in the bulb, you would then have to use radiosity to get 
them to cast illumination on their surroundings.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

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