POV-Ray : Newsgroups : povray.binaries.images : lightsource: looks_like on one side Server Time
17 Aug 2024 06:25:46 EDT (-0400)
  lightsource: looks_like on one side (Message 1 to 3 of 3)  
From: marabou
Subject: lightsource: looks_like on one side
Date: 5 Nov 2001 10:17:03
Message: <3be6ad6d@news.povray.org>
hello,

as probed different lamps i get confused as i tried this:
a lamp consists of a quarter of a sphere and has a flat cylinder on it 
which emitts the light and hangs on a wall (see pic). 
at first i tried to make this object and give to light_source the parameter 
"look_as", second i build this object with a light_source in it.
both times the results are not satifactionally (see pics).
does someone know what i did not see?

first call:
light_source {
        < 0,0,0 >
        color White
        looks_like { hohllampe (off)}
        translate < towhereyouwant >
}

second call:
object { hohllampe(on)
        translate < towhereyouwant >
}

//code for
//------------------------------hohllampe
//glow = on -> self glowing
//glow = whatyouwant -> not self glowing

#macro hohllampe (glow)

union{
difference{
//main body
sphere {
        <0,0,0>,1
        scale <0.15,0.15,0.15>
}
//two boxes cut the sphere
box {
        <-0.5,0,-0.5>,<0.5,1,0.5>
}
box {
        <-0.5,-0.5,0>,<0.5,0.5,1>
}
        pigment {color White}
        //finish {ambient 0}
}//difference main body
//light source
cylinder{
        <0,0,0>,<0,1,0>,1
        scale <0.15,0.01,0.15>
        pigment { color White}
        no_shadow
        finish{ ambient 0.25}
}
#if (glow=on)
        light_source {
                <0.07,0.005,-0.07>
                color White
                adaptive 1
        }
#end//if
}//union
#end//macro
//------------------------------hohllampe


Post a reply to this message


Attachments:
Download 'lampprob.jpg' (9 KB)

Preview of image 'lampprob.jpg'
lampprob.jpg


 

From: marabou
Subject: correction: lightsource: looks_like on one side
Date: 5 Nov 2001 10:28:20
Message: <3be6b014@news.povray.org>
one correction:
the first call equals number II in pic! and the second to number I!
sorry.


Post a reply to this message

From: Trevor Quayle
Subject: Re: lightsource: looks_like on one side
Date: 5 Nov 2001 12:18:42
Message: <3be6c9f2$1@news.povray.org>
Two points here:

1) You probably don't want to use looks_like for the whole lamp as
looks_like = no_shadow for the whole object and I assume you wnat parts of
the lamp to shade the light as in call 2.

2) I think the problem that you see with the lighting has to do with the
light source being so close to the wall.  When a light source is close to a
flat surface like that, the illumination falls off very rapidly, if you look
at the side walls, they are probably better lit than the wall with the lamp
on.  There was some discussion a while back about this and IIRC, it was
pointed out that this is a somewhat realistic behavior, if you look at the
ceiling of a room with a ceiling light, it will seem less lit than walls.

Someone else probably has more info on this than I.

-tgq


"marabou" <not### [at] availableyet> wrote in message
news:3be6ad6d@news.povray.org...
>
> hello,
>
> as probed different lamps i get confused as i tried this:
> a lamp consists of a quarter of a sphere and has a flat cylinder on it
> which emitts the light and hangs on a wall (see pic).
> at first i tried to make this object and give to light_source the
parameter
> "look_as", second i build this object with a light_source in it.
> both times the results are not satifactionally (see pics).
> does someone know what i did not see?
>
> first call:
> light_source {
>         < 0,0,0 >
>         color White
>         looks_like { hohllampe (off)}
>         translate < towhereyouwant >
> }
>
> second call:
> object { hohllampe(on)
>         translate < towhereyouwant >
> }
>
> //code for
> //------------------------------hohllampe
> //glow = on -> self glowing
> //glow = whatyouwant -> not self glowing
>
> #macro hohllampe (glow)
>
> union{
> difference{
> //main body
> sphere {
>         <0,0,0>,1
>         scale <0.15,0.15,0.15>
> }
> //two boxes cut the sphere
> box {
>         <-0.5,0,-0.5>,<0.5,1,0.5>
> }
> box {
>         <-0.5,-0.5,0>,<0.5,0.5,1>
> }
>         pigment {color White}
>         //finish {ambient 0}
> }//difference main body
> //light source
> cylinder{
>         <0,0,0>,<0,1,0>,1
>         scale <0.15,0.01,0.15>
>         pigment { color White}
>         no_shadow
>         finish{ ambient 0.25}
> }
> #if (glow=on)
>         light_source {
>                 <0.07,0.005,-0.07>
>                 color White
>                 adaptive 1
>         }
> #end//if
> }//union
> #end//macro
> //------------------------------hohllampe


Post a reply to this message

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