POV-Ray : Newsgroups : povray.general : Applying an image map to a transparent object Server Time
13 Aug 2024 17:21:17 EDT (-0400)
  Applying an image map to a transparent object (Message 1 to 3 of 3)  
From: Curtis R  Anderson
Subject: Applying an image map to a transparent object
Date: 4 Aug 1998 19:20:37
Message: <35C77A10.49EB4250@intelligencia.com>
I have designed a "wide-mouth mayonnaise jar" CSG object which looks as
good as I can get it.

Now when I go about applying an image map to one of the CSG components,
using 3.1 beta 5 for Windows, I do not see the image. Instead it comes
out black. Alpha channel transparency at least works.

I use a color of "rgbf <1.0, 1.0, 1.0, 0.9>" for all the CSG objects,
but the image map seems to reset the color to "rgbf <1.0, 1.0, 1.0,
1.0>". The option "transmit all 0.9" doesn't seem to help.

Here is the file in question:

#include "glass.inc"
#include "colors.inc"

//
// Glop jar file.
//

#declare Glop_Jar2 = difference {
   merge {

      //
      // The main body.
      //

      cylinder {
         < 0.000,  0.150, 0>,
         < 0.000,  1.000, 0>,
         0.500
         texture {
            pigment {
               image_map {
                  png "glop3.png"
                  map_type 2
                  once
               }
            }
            finish { F_Glass1 }
            scale <1, 0.85, 1>
            translate 0.150 * y
            rotate -90 * y
         }
      }

      //
      // The curve along the bottom.
      //

      torus {
         0.350, 0.150
         translate 0.15 * y
      }

      //
      // The bottom piece.
      //

      cylinder {
         < 0.000,  0.000, 0>,
         < 0.000,  0.150, 0>,
         0.350
      }

      //
      // The taper.
      //

      cone {
         < 0.000,  1.000, 0>,
         0.500,
         < 0.000,  1.400, 0>,
         0.400
      }

      //
      // The jar lid thread.
      //

      cylinder {
         < 0.000,  1.400, 0>,
         < 0.000,  1.625, 0>,
         0.400
      }

      //
      // The jar lid stop.
      //

      torus {
         0.400, 0.025
         translate 1.45 * y
      }
   }
   sphere {
      <0.000, -0.500, 0.000>,
      0.600
   }
   union {

      //
      // We need to get an inner curve too.
      //

      sphere {
         < 0.000,  0.200, 0>,
         0.450
         scale <1.0, 0.05 / 0.45, 1.0>
      }

      //
      // The main body.
      //

      cylinder {
         < 0.000,  0.200, 0>,
         < 0.000,  0.975, 0>,
         0.450
      }

      //
      // The taper.
      //

      cone {
         < 0.000,  0.975, 0>,
         0.450,
         < 0.000,  1.375, 0>,
         0.350
      }

      //
      // The jar lid section.
      //

      cylinder {
         < 0.000,  1.375, 0>,
         < 0.000,  1.625, 0>,
         0.350
      }
   }
   interior { I_Glass }
   texture {
      pigment {
         color rgbf <1.0, 1.0, 1.0, 0.9>
      }
      finish { F_Glass1 }
   }
   translate -0.8125 * y
   scale 2
}

// end code

The PNG files can be made available on request.
-- 
Curtis R. Anderson, Co-creator of "Gleepy the Hen", SP 2.5?, KoX
http://www.servtech.com/~cra/         | Welcome to Gnu-EMACS:
ftp://ftp.servtech.com/pub/users/cra/ |  Press BACKSPACE For Help
mailto:gle### [at] intelligenciacom       | (insert Yiddish words here)


Post a reply to this message

From: Jerry Anning
Subject: Re: Applying an image map to a transparent object
Date: 5 Aug 1998 01:52:19
Message: <35C7E507.EF06320D@dhol.com>
Curtis R. Anderson wrote:

> Now when I go about applying an image map to one of the CSG components,
> using 3.1 beta 5 for Windows, I do not see the image. Instead it comes
> out black. Alpha channel transparency at least works.

The problem is in the finish.  F_Glass1 sets ambient and diffuse to 0. 
This kills the image map.  All you need to do is replace the finish
statement on the image mapped part with:
finish {
specular 1
roughness .001
reflection 0.1 }

These are the settings of F_Glass1 without the offending ambient and
diffuse statements.  F_Glass1 is ok for the non-image mapped part.  This
worked well for me.  BTW, you need the interior {I_Glass} statement in
the non-image mapped part as well.

Jerry Anning
cle### [at] dholcom


Post a reply to this message

From: Curtis R  Anderson
Subject: Re: Applying an image map to a transparent object
Date: 6 Aug 1998 00:57:15
Message: <35C92998.7C63DE43@intelligencia.com>
Jerry Anning wrote:
> 
> Curtis R. Anderson wrote:
> 
> > Now when I go about applying an image map to one of the CSG components,
> > using 3.1 beta 5 for Windows, I do not see the image. Instead it comes
> > out black. Alpha channel transparency at least works.
> 
> The problem is in the finish.  F_Glass1 sets ambient and diffuse to 0.
> This kills the image map.  All you need to do is replace the finish
> statement on the image mapped part with:
> finish {
> specular 1
> roughness .001
> reflection 0.1 }
> 
> These are the settings of F_Glass1 without the offending ambient and
> diffuse statements.  F_Glass1 is ok for the non-image mapped part.  This
> worked well for me.  BTW, you need the interior {I_Glass} statement in
> the non-image mapped part as well.

I will give that a try. (Maybe something to that effect can be put in
the manual...?)
-- 
Curtis R. Anderson, Co-creator of "Gleepy the Hen", SP 2.5?, KoX
http://www.servtech.com/~cra/         | Welcome to Gnu-EMACS:
ftp://ftp.servtech.com/pub/users/cra/ |  Press BACKSPACE For Help
mailto:gle### [at] intelligenciacom       | (insert Yiddish words here)


Post a reply to this message

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