POV-Ray : Newsgroups : povray.newusers : Reflect light inside box Server Time
13 May 2024 21:21:16 EDT (-0400)
  Reflect light inside box (Message 1 to 10 of 18)  
Goto Latest 10 Messages Next 8 Messages >>>
From: Rhonda
Subject: Reflect light inside box
Date: 10 Dec 2012 15:45:00
Message: <web.50c6497b5da86ae0e6e840160@news.povray.org>
I'm trying to draw a box, where the bottom half of the side of the box facing
the light source is cut away, allowing the light to enter the box. I've tried
using clipped_by and difference, and a few other things, but nothing is really
working. Probably because I have no idea what I'm doing. Can someone provide
some guidance?

Thanks in advance.

Rhonda


Here's the current, non-working version of my code:

background { color Blue }
camera {
    location <0, 10, -50>
    look_at  <0, 0,  20>
}

box {
    < -10,  0,  0>,   // left corner
    <10, 20,   20>  // right corner
   hollow
    texture {
      Aluminum
 pigment { color Green }
    }
 interior
 { ior 1.5
 }
      finish {
       reflection {
   0.9, 1.0
   fresnel on
   metallic on
  }
     }
     clipped_by { box {
       <-9,1,0>,<9,10,1 >
     }
     }
rotate y*20

}

light_source { <5, 20, -30>
 color White
 }


Post a reply to this message

From: Leroy
Subject: Re: Reflect light inside box
Date: 10 Dec 2012 16:45:43
Message: <50c65807@news.povray.org>
Rhonda wrote:
> I'm trying to draw a box, where the bottom half of the side of the box facing
> the light source is cut away, allowing the light to enter the box. I've tried
> using clipped_by and difference, and a few other things, but nothing is really
> working. Probably because I have no idea what I'm doing. Can someone provide
> some guidance?
> 
> Thanks in advance.
> 
> Rhonda
> 
> 
> Here's the current, non-working version of my code:
> 
> background { color Blue }
> camera {
>     location <0, 10, -50>
>     look_at  <0, 0,  20>
> }
> 
> box {
>     < -10,  0,  0>,   // left corner
>     <10, 20,   20>  // right corner
>    hollow
>     texture {
>       Aluminum
>  pigment { color Green }
>     }
>  interior
>  { ior 1.5
>  }
>       finish {
>        reflection {
>    0.9, 1.0
>    fresnel on
>    metallic on
>   }
>      }
>      clipped_by { box {
>        <-9,1,0>,<9,10,1 >
>      }
>      }
> rotate y*20
> 
> }
> 
> light_source { <5, 20, -30>
>  color White
>  }
> 
> 
> 
> 

your "clipped_by" needs to be bigger
What ever in Not in the 'clipped_by' get cuts off
When I use a box to clipped a box I just copy values front the box I
want to clip put in the 'clipped_by ' statement then and 1 to each 
number the vectors. Except the on I want to cut off!

try:
      clipped_by { box {
        < -11,  -1,  0>,<11, 21,   21>
      }

Have Fun!


Post a reply to this message

From: Stephen
Subject: Re: Reflect light inside box
Date: 10 Dec 2012 16:53:36
Message: <50c659e0$1@news.povray.org>
On 10/12/2012 8:43 PM, Rhonda wrote:
> Probably because I have no idea what I'm doing. Can someone provide
> some guidance?
>
> Thanks in advance.

Join the club Rhonda. :-)

Primitives in PovRay are solids (sometime they are only surfaces o_O)
So what you need to do is make a box with six thin boxes. forming the 
walls, floors and ceiling. Use a union to join them then difference that 
with another box.
You only need to use the keyword "hollow" if you are going to fill it 
with media, such as scattering if you want to see the light.

I hope that helps and welcome.

-- 
Regards
     Stephen


Post a reply to this message

From: Alain
Subject: Re: Reflect light inside box
Date: 10 Dec 2012 21:26:38
Message: <50c699de@news.povray.org>

> I'm trying to draw a box, where the bottom half of the side of the box facing
> the light source is cut away, allowing the light to enter the box. I've tried
> using clipped_by and difference, and a few other things, but nothing is really
> working. Probably because I have no idea what I'm doing. Can someone provide
> some guidance?
>
> Thanks in advance.
>
> Rhonda
>
><code clipped>
>
>

Your box is solid. If you do a difference or intersection, the resulting 
shape is always closed.

You missuse the "hollow" keyword. It's a very common mistake. The 
purpose of hollow is to enable the existance of some media in the 
object. Otherwise, it have absolutely no effect. Also, the hollow, media 
containing object normaly need to be transparent so that the media is 
visible.

As have been said, clipped_by remove whatever is outside the clipping 
object. You can reverse that by using the "inverse" keyword that reverse 
the insideness of any object.

clipped_by{box{-1,1 inverse}} can be used to punch a hole in any object.
Here, {-1,1} is promoted to {<-1,-1,-1>,<1,1,1>}.

Your use of interior is OK.

When present, fresnel and metallic default to on. You don't need to 
explicitely specify it. They default to off when NOT present. metallic 
can use a float value from zero to whatever you want, but normaly no 
larger that 1.

Using color in the colors definitions and application is mostly a legacy 
thing and not needed.
pigment{ color Red } does exactly the same thing as pigment{ Red }.


Another thing you can do is to model a box with a thickness using a 
difference:

difference{
  box{< -10,  0,  0>,<10, 20,   20>}//outside of the box
  box{<-9.6,0.4,0.4><9.6,19.6,19.6>}//inside of the box
// the walls now have a thickness of 0.4 unit
  box{<-9,1,0.4>,<9,10,1 >}// the opening
  texture{pigment{rgb<0.1,1,0.2>}finish{reflection{0.3, 1 fresnel 
metallic}specular 1 roughness 0.1}
}

Now, the light comming into the opening will not actualy reflect in the 
box. The highlight will reflect, but not the incoming light. For that, 
you need to use the photons feature.
Add:

global_settings{photons{spacing 0.1}}
This turn on the photons feature.
You may also use count Value. Don't use both spacing and count.
With spacing, a small value increase the total number of photons shot. 
Small values increase the quality.
With count, you specify a target number of photons to shoot. Large value 
increase the quality.

In the object definition, add, just before the closing bracket:

photons{target reflection on}
This allow photons to be shot at the object and reflect off it.
As your object is not transparent, you can leave refraction to it's 
default of off.

You DON'T need to add any photons{} block to any light_source.

Now, another trick: Use the object pattern.
Change your texture as follow:
texture{
  object{box{<-9,1,0.0001>,<9,10,1 >}Your_texture, pigment{rgbt 1}}
  }

All points outside the box will receive Your_texture and points inside 
if it will be totaly transparent.
"Your_texture" been the texture you use now.
This will "paint" a transparent area in your box.
I replaced the zero by 0.0001 so that the opening will only show into 
the side and not the floor of the box.




Alain


Post a reply to this message

From: Rhonda
Subject: Re: Reflect light inside box
Date: 11 Dec 2012 14:35:01
Message: <web.50c789d7cf1ff5fee6e840160@news.povray.org>
This is all really helpful, thank you. I think I'm making progress. I still have
a few issues.

This is what I now have:

global_settings{photons{spacing 0.1}}

#declare my_texture =
 texture {
  finish{
     reflection{
      0.3, 1
      fresnel
    metallic
   }
   specular 1
   roughness 0.1
  }
 }

background { color Blue }
camera {
    location <0, 10, -50>
    look_at  <0, 0,  20>

  }

difference{
  box{< -10,  0,  0>,<10,  20,   20>}//outside of the box
  box{<-9.6, 0.4, 0.4>,<9.6, 19.6, 19.6>}//inside of the box
// the walls now have a thickness of 0.4 unit
  box{<-9,1, 0>,<9, 10, 0.4>}// the opening
  texture{
   object{
    box{<-9,1,0.0001>,<9,10,1 >}
    my_texture,
    pigment {rgbt 1}
  }
  }


photons{target reflection on}

 rotate y*20
}

light_source { <5, 20, -30>
 color White
}

I'm getting an error on the

texture{
   object{
    box{<-9,1,0.0001>,<9,10,1 >}
    my_texture,
    pigment {rgbt 1}
  }
  }

code, saying that there is a missing }, but I don't see it.

Also, did I put the photons{target reflection on} in the right place, or do I
need to create an object that includes the box and the photons?

Rhonda


Post a reply to this message

From: James Holsenback
Subject: Re: Reflect light inside box
Date: 11 Dec 2012 16:18:30
Message: <50c7a326$1@news.povray.org>
On 12/11/2012 02:31 PM, Rhonda wrote:
> This is all really helpful, thank you. I think I'm making progress. I still have
> a few issues.
>
> This is what I now have:
>
> global_settings{photons{spacing 0.1}}
>
> #declare my_texture =
>   texture {
>    finish{
>       reflection{
>        0.3, 1
>        fresnel
>      metallic
>     }
>     specular 1
>     roughness 0.1
>    }
>   }

the metallic keyword belongs in the finish block ... not the reflection 
block. The rest looked OK (quick glance)


Post a reply to this message

From: James Holsenback
Subject: Re: Reflect light inside box
Date: 11 Dec 2012 16:20:50
Message: <50c7a3b2@news.povray.org>
On 12/11/2012 04:18 PM, James Holsenback wrote:
> On 12/11/2012 02:31 PM, Rhonda wrote:
>> This is all really helpful, thank you. I think I'm making progress. I
>> still have
>> a few issues.
>>
>> This is what I now have:
>>
>> global_settings{photons{spacing 0.1}}
>>
>> #declare my_texture =
>>   texture {
>>    finish{
>>       reflection{
>>        0.3, 1
>>        fresnel
>>      metallic
>>     }
>>     specular 1
>>     roughness 0.1
>>    }
>>   }
>
> the metallic keyword belongs in the finish block ... not the reflection
> block. The rest looked OK (quick glance)

LOL ... after reading further I see that that keyword /can/ indeed live 
in the reflection block ... going back into my corner now.


Post a reply to this message

From: clipka
Subject: Re: Reflect light inside box
Date: 11 Dec 2012 17:31:24
Message: <50c7b43c$1@news.povray.org>
Am 11.12.2012 22:20, schrieb James Holsenback:

>> the metallic keyword belongs in the finish block ... not the reflection
>> block. The rest looked OK (quick glance)
>
> LOL ... after reading further I see that that keyword /can/ indeed live
> in the reflection block ... going back into my corner now.

Actually, if you use "metallic", you should put it in /both/ the finish 
and reflection block: The one makes the highlights look metallic, the 
other does the same for reflections.


Post a reply to this message

From: Rhonda
Subject: Re: Reflect light inside box
Date: 11 Dec 2012 18:15:01
Message: <web.50c7be34cf1ff5fee6e840160@news.povray.org>
Thanks for the input. Any thoughts on why this isn't working:

texture{
   object{
    box{<-9,1,0.0001>,<9,10,1 >}
    my_texture,
    pigment {rgbt 1}
  }
  }


where, this is declared above

#declare my_texture=
 texture {
  finish{
     reflection{
      0.3, 1
      fresnel
    metallic
   }
   specular 1
   roughness 0.1
  }
 }


Post a reply to this message

From: James Holsenback
Subject: Re: Reflect light inside box
Date: 11 Dec 2012 18:53:31
Message: <50c7c77b$1@news.povray.org>
On 12/11/2012 06:13 PM, Rhonda wrote:
> Thanks for the input. Any thoughts on why this isn't working:
>
> texture{
>     object{
>      box{<-9,1,0.0001>,<9,10,1 >}
>      my_texture,
>      pigment {rgbt 1}
>    }
>    }
>
>
> where, this is declared above
>
> #declare my_texture=
>   texture {
>    finish{
>       reflection{
>        0.3, 1
>        fresnel
>      metallic
>     }
>     specular 1
>     roughness 0.1
>    }
>   }
>
>
>
>
check out:
http://wiki.povray.org/content/Reference:Object_Pattern


shown in the example


Post a reply to this message

Goto Latest 10 Messages Next 8 Messages >>>

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