POV-Ray : Newsgroups : povray.newusers : Reflection Inside of a Sphere Server Time
31 Oct 2024 16:14:28 EDT (-0400)
  Reflection Inside of a Sphere (Message 1 to 10 of 10)  
From: philrymek
Subject: Reflection Inside of a Sphere
Date: 12 Oct 2007 18:25:01
Message: <web.470ff3d2768143642b80c6510@news.povray.org>
Greetings all.

I am new to POV-Ray and I am trying to accomplish the following.  I have a
sphere with a checkered box inside it, and I want the box to reflect inside
of the sphere.  I  have already made a reflective sphere with checkered box
and light source inside, but the checkered box does not reflect inside of
the sphere.  Any ideas on how to accomplish this?

Much thanks.


Post a reply to this message

From: Le Forgeron
Subject: Re: Reflection Inside of a Sphere
Date: 12 Oct 2007 18:40:21
Message: <470ff7d5$1@news.povray.org>
Le 13.10.2007 00:23, philrymek nous fit lire :
> Greetings all.
> 
> I am new to POV-Ray and I am trying to accomplish the following.  I have a
> sphere with a checkered box inside it, and I want the box to reflect inside
> of the sphere.  I  have already made a reflective sphere with checkered box
> and light source inside, but the checkered box does not reflect inside of
> the sphere.  Any ideas on how to accomplish this?

Know your optics...

The box inside the sphere is mainly visible at the opposite
location, according to the center of the sphere.
(and then in nearly all directions).

If your camera is somewhere else, the probability to find the box in
reflection drops a lot, and you'd better orient it with smart maths...

Now, also, beware of max trace level... raise it a lot, that could
help too (default value is so low...).
-- 
The superior man understands what is right;
the inferior man understands what will sell.
-- Confucius


Post a reply to this message

From: philrymek
Subject: Re: Reflection Inside of a Sphere
Date: 12 Oct 2007 19:50:00
Message: <web.4710080ecf149b782b80c6510@news.povray.org>
The box, the camera, the light source are all centered around 0.0.

Is the opposite of 0, 0? Or is it undefined?



// Persistence of Vision Ray Tracer Scene Description File
// File: ?.pov
// Vers: 3.6
// Desc: Checkered Floor Example
// Date: mm/dd/yy
// Auth: ?
//

#version 3.6;

#include "colors.inc"

global_settings {
  assumed_gamma 1.0
  max_trace_level 15
}

// ----------------------------------------

camera {
  location  <0, 0, 1>
  direction 1.5*z
  right     x*image_width/image_height
  look_at   <0, 0,  0>
}


sky_sphere {
  pigment {
    gradient y
    color_map {
      [0.0 rgb <0.6,0.7,1.0>]
      [0.7 rgb <0.0,0.1,0.8>]
    }
  }
}

light_source {
  <0, 0, 0>            // light's position (translated below)
  color rgb <1, 1, 1>  // light's color
  translate <-30, -30, -30>
}


plane {               // red floor
  y, -1
  texture
  {
     pigment {
      color red  1
    }
    finish{
      diffuse 0.8
      ambient 0.1
    }
  }
}


sphere {              // reflective sphere
  0.0, 2
  hollow 1
  texture {
    pigment {
      color rgb <0.8,0.8,1.0>
    }
    finish{
      diffuse 0.0
      ambient 0.0
      specular 0.0
      reflection {
        10
      }
      conserve_energy
    }
  }
}


// create a box that extends between the 2 specified points
box {
  <-.01, -.01, -.01>  // one corner position <X1 Y1 Z1>
  <.01, .01,  .01>  // other corner position <X2 Y2 Z2>
    texture
  {
    pigment {
      checker
      color rgb <0,0,0>
      color rgb <255,255,255>
      scale .01
    }
    finish{
      diffuse 0.8
      ambient 0.1
    }
  }
}


Post a reply to this message

From: Le Forgeron
Subject: Re: Reflection Inside of a Sphere
Date: 13 Oct 2007 04:06:23
Message: <47107c7f$1@news.povray.org>
Le 13.10.2007 01:49, philrymek nous fit lire :
> The box, the camera, the light source are all centered around 0.0.
> 
> Is the opposite of 0, 0? Or is it undefined?

I can see your box, despite the wrong direction (so it's reflected).
I just reduce the reflection from 10 to 1.

Image of 800x600 is nearly black, with a small 30x30 pixels zone at
the center for the reflection of the checker.

Raising reflection to 3 give a vertical conical red (hyperboloid
like) addition, which get more strength with more reflection.

translating the box at <0,0,-1> is more interesting but its better
with a far higher max_trace_level (15 is limited, 256 is better) but
a reflection of 0.9 (at least damping the rays) avoid long render time.
(you can also play with the 0.9 factor to use a 0.99 if ready for
that...)



-- 
The superior man understands what is right;
the inferior man understands what will sell.
-- Confucius


Post a reply to this message

From: Tim Attwood
Subject: Re: Reflection Inside of a Sphere
Date: 13 Oct 2007 22:57:11
Message: <47118587$1@news.povray.org>
> I am new to POV-Ray and I am trying to accomplish the following.  I have a
> sphere with a checkered box inside it, and I want the box to reflect 
> inside
> of the sphere.  I  have already made a reflective sphere with checkered 
> box
> and light source inside, but the checkered box does not reflect inside of
> the sphere.  Any ideas on how to accomplish this?

This is almost a worst case scenario for a ray-tracer, what you
would see in real life is a funhouse hall-of-mirrors effect.

In a ray-tracer the rays come from the camera instead of the light,
and can't travel to infinity, they stop after some number of
bounces (max_trace_level).

In real life rays come from light sources, bounce around and are
absorbed/re-emited, bent an infinite number of times before eventually
reaching your eye.

I also noticed some minor glitches...

POV uses colors ranging from 0..1 even though higher numbers
are allowed they are saturated.
pigment {rgb <1,1,1>}
pigment {White}
are white.

The light source is outside of your sphere but the camera is inside,
so there is no lighting.

reflection ranges from 0 (no reflection) to 1 (100% reflection),

hollow doesn't require a parameter... in POV... the constants
on, yes, and true equate to the value 1
off, no, and false equate to the value 0
in some early versions the usage "hollow on" was
used and that usage has been maintained only for legacy
compatability.
Since your camera is inside the sphere it makes more sense
to use the inverse keyword, so that you are looking at the
front of the sphere's texture, instead of the back, though
it doesn't matter much with a simple reflective surface.


Post a reply to this message

From: Christian Froeschlin
Subject: Re: Reflection Inside of a Sphere
Date: 14 Oct 2007 04:55:55
Message: <4711d99b$1@news.povray.org>
> reflection ranges from 0 (no reflection) to 1 (100% reflection),

Well, it's perfectly legal to reflect more light than falls in,
although it doesn't make a lot of sense physically.


Post a reply to this message

From: Warp
Subject: Re: Reflection Inside of a Sphere
Date: 14 Oct 2007 05:18:39
Message: <4711deef@news.povray.org>
Christian Froeschlin <chr### [at] chrfrde> wrote:
> Well, it's perfectly legal to reflect more light than falls in,
> although it doesn't make a lot of sense physically.

  I think negative reflection is also possible (although I have never
tried it).

-- 
                                                          - Warp


Post a reply to this message

From: Alain
Subject: Re: Reflection Inside of a Sphere
Date: 14 Oct 2007 17:53:59
Message: <47128ff7$1@news.povray.org>
Warp nous apporta ses lumieres en ce 2007/10/14 05:18:
> Christian Froeschlin <chr### [at] chrfrde> wrote:
>> Well, it's perfectly legal to reflect more light than falls in,
>> although it doesn't make a lot of sense physically.
> 
>   I think negative reflection is also possible (although I have never
> tried it).
> 
Negative reflection values are possible but returns black. Even with a 
background that have negative RGB values.

-- 
Alain
-------------------------------------------------
WARNING: The consumption of alcohol may make you think you can logically 
converse with members of the opposite sex without spitting.


Post a reply to this message

From: Warp
Subject: Re: Reflection Inside of a Sphere
Date: 14 Oct 2007 20:10:31
Message: <4712aff7@news.povray.org>
Alain <ele### [at] netscapenet> wrote:
> Negative reflection values are possible but returns black. Even with a 
> background that have negative RGB values.

  Perhaps that artificial limitation could be removed. :P

-- 
                                                          - Warp


Post a reply to this message

From: Alain
Subject: Re: Reflection Inside of a Sphere
Date: 15 Oct 2007 12:21:19
Message: <4713937f@news.povray.org>
Warp nous apporta ses lumieres en ce 2007/10/14 20:10:
> Alain <ele### [at] netscapenet> wrote:
>> Negative reflection values are possible but returns black. Even with a 
>> background that have negative RGB values.
> 
>   Perhaps that artificial limitation could be removed. :P
> 
Making reflection work more similarly to transmit and filter.

-- 
Alain
-------------------------------------------------
Always try to be modest, and be proud of it!


Post a reply to this message

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