POV-Ray : Newsgroups : povray.newusers : Image map covers my rainbow Server Time
24 Nov 2024 23:26:47 EST (-0500)
  Image map covers my rainbow (Message 1 to 4 of 4)  
From: Hugh
Subject: Image map covers my rainbow
Date: 24 Mar 2007 07:25:02
Message: <web.4605188c953ef0f3762669c60@news.povray.org>
Hi all,

  I'm trying to create an animation where an aircraft flies past a building
with a rainbow in the background.  The aircraft is a png file with a
transparent background that I am using as an image map in a box object.  It
flies in front of the building without blocking outside of the aircraft's
silhouette.  However, when  it passes in front of the rainbow, something is
causing a box-shaped area to be blocked on the rainbow.  I've tried a number
of things but since I've only been at this a week, there's a lot that I
don't know yet.  I'm supplying the code that I'm using below.  Thanks in
advance for any help.

Hugh

#include "colors.inc"
#include "stones.inc"

#declare r_violet1 = color rgbf<1.0, 0.5, 1.0, 1.0>;
#declare r_violet2 = color rgbf<1.0, 0.5, 1.0, 0.8>;
#declare r_indigo = color rgbf<0.5, 0.5, 1.0, 0.8>;
#declare r_blue = color rgbf<0.2, 0.2, 1.0, 0.8>;
#declare r_cyan = color rgbf<0.2, 1.0, 1.0, 0.8>;
#declare r_green = color rgbf<0.2, 1.0, 0.2, 0.8>;
#declare r_yellow = color rgbf<1.0, 1.0, 0.2, 0.8>;
#declare r_orange = color rgbf<1.0, 0.5, 0.2, 0.8>;
#declare r_red1 = color rgbf<1.0, 0.2, 0.2, 0.8>;
#declare r_red2 = color rgbf<1.0, 0.2, 0.2, 1.0>;


camera {
 location <10, 30, -20>
 look_at <10, 40, 0>
 // Animation setting
// location <-10, 30, -50>
// look_at <0, 25, 0>
}

light_source { <-20, 120, -20> color White }

background { rgb <.7, .7, 1> }

plane {
 y, 0
 pigment { color Green }
 finish { ambient .3 diffuse .7 }
}

// -------- Sky -------------
sky_sphere {
 pigment {
  bozo
  turbulence 0.65
  octaves 6
  omega 0.7
  lambda 2
  color_map {
   [0.0 0.1 color rgb <0.85, 0.85, 0.85>
    color rgb <0.75, 0.75, 0.75>]
   [0.1 0.5 color rgb <0.75, 0.75, 0.75>
    color rgbt <1, 1, 1, 1>]
   [0.5 1.0 color rgbt <1, 1, 1, 1>
    color rgbt <1, 1, 1, 1>]
  }
  scale <0.2, 0.5, 0.2>
 }
 rotate -150*x
 rotate -150*z
}


// Gently disappearing rainbow in the sky
rainbow {
 angle 42.5
 width 5
 arc_angle 170
 falloff_angle 30
 distance 1.0e5
 direction <-0.2, -0.2, 1>
 jitter 0.01
 color_map {
  [0.000 color r_violet1 transmit 0.25]
  [0.100 color r_violet2 transmit 0.25]
  [0.214 color r_indigo transmit 0.25]
  [0.328 color r_blue transmit 0.3]
  [0.442 color r_cyan transmit 0.25]
  [0.556 color r_green transmit 0.25]
  [0.670 color r_yellow transmit 0.25]
  [0.784 color r_orange transmit 0.2]
  [0.900 color r_red1 transmit 0.45]
 }
}

// Temporary stone box representing the building
box {
 <-8, 0, 0>, // Near lower left corner
 < 8, 40, 10> // Far upper right corner
 texture {
  T_Stone25 // Pre-defined from stones.inc
  scale 4 // Scale by the same amount in all
  // directions
 }
 rotate y*20 // Equivalent to "rotate <0,20,0>"
 translate <0, 0, 20>
}

// Aircraft containment box
box {
 <-9, -3, 0>, // Near lower left corner
 < 8, 2, 0> // Far upper right corner
 pigment {
  image_map{
   png "B2FrontClean.png"
   once
  }
  scale <16, 4, 0>
  translate <-8.35, -2.65, 0>
 }
 rotate <0, -30, 90>
 // This translation is for static viewing
 translate <10, 40, 0>
        // These are for the animation
// translate <-20, 40, 0>
// translate <10*clock, 0, 0>
}


Post a reply to this message

From: Hugh
Subject: Re: Image map covers my rainbow
Date: 24 Mar 2007 07:50:02
Message: <web.46051e29205acee1762669c60@news.povray.org>
"Hugh" <nomail@nomail> wrote:
> Hi all,
>
>   I'm trying to create an animation where an aircraft flies past a building
> with a rainbow in the background.  The aircraft is a png file with a
> transparent background that I am using as an image map in a box object.  It
> flies in front of the building without blocking outside of the aircraft's
> silhouette.  However, when  it passes in front of the rainbow, something is
> causing a box-shaped area to be blocked on the rainbow.  I've tried a number
> of things but since I've only been at this a week, there's a lot that I
> don't know yet.  I'm supplying the code that I'm using below.  Thanks in
> advance for any help.
>
> Hugh
>
>
> // Aircraft containment box
> box {
>  <-9, -3, 0>, // Near lower left corner
>  < 8, 2, 0> // Far upper right corner
>  pigment {
>   image_map{
>    png "B2FrontClean.png"
>    once
>   }
>   scale <16, 4, 0>
>   translate <-8.35, -2.65, 0>
>  }
>  rotate <0, -30, 90>
>  // This translation is for static viewing
>  translate <10, 40, 0>
>         // These are for the animation
> // translate <-20, 40, 0>
> // translate <10*clock, 0, 0>
> }

Using the reflective floor example in the tutorial, I've added the following
after my aircraft pigment and now the building gets blocked.  I'm getting
closer but, please let me know if anyone knows how to tweak this correctly.

 photons { pass_through }
 hollow interior
 {
  media
  {
   scattering { 1, 0.07 extinction 0.01 }
   samples 30,100
  }
 }


Post a reply to this message

From: Mark Birch
Subject: Re: Image map covers my rainbow
Date: 26 Mar 2007 19:30:02
Message: <web.46086524205acee14daddc090@news.povray.org>
I'm not sure what you are trying to achieve with the media & photons. Unless
they are specifically adding something to the scene I would remove them
since it won't work as a bugfix.

I tried your scene file, and two things that worked were:

1.  Add the 'hollow' keyword just before the pigment definition.  Because
the box has zero thickness, povray may be hitting the back wall before it
hits the front wall, and then things get confusing.  Or mabye it thinks
it's still inside the box when it isn't.

OR

2.  Give the box a very small thickness, say 0.001.

Either approach seemed to work, I can't be sure of the total effect because
I don't have your PNG file.

I think the problem stems from using a zero thickness solid object, instead
of a one-sided object.  You could try using a union of two triangles, or a
polygon object, or a disc, in place of the box.


Post a reply to this message

From: Alain
Subject: Re: Image map covers my rainbow
Date: 27 Mar 2007 18:17:09
Message: <4609a5f5@news.povray.org>
Mark Birch nous apporta ses lumieres en ce 26-03-2007 20:28:
> I'm not sure what you are trying to achieve with the media & photons. Unless
> they are specifically adding something to the scene I would remove them
> since it won't work as a bugfix.

> I tried your scene file, and two things that worked were:

> 1.  Add the 'hollow' keyword just before the pigment definition.  Because
> the box has zero thickness, povray may be hitting the back wall before it
> hits the front wall, and then things get confusing.  Or mabye it thinks
> it's still inside the box when it isn't.

> OR

> 2.  Give the box a very small thickness, say 0.001.

> Either approach seemed to work, I can't be sure of the total effect because
> I don't have your PNG file.

> I think the problem stems from using a zero thickness solid object, instead
> of a one-sided object.  You could try using a union of two triangles, or a
> polygon object, or a disc, in place of the box.


You still need to add hollow, especialy with the disc. The disc object is 
similar to a plane where only a small portion is visible, the part oposite to 
it's normal is considered as "inside" of it, even outside of the visible part.

-- 
Alain
-------------------------------------------------
"We returned the General to El Salvador, or maybe Guatemala, it's difficult to 
tell from 10,000 feet."           -- Anon.


Post a reply to this message

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