POV-Ray : Newsgroups : povray.general : Placing label on povray beer bottle : Re: Placing label on povray beer bottle Server Time
13 Aug 2024 17:25:28 EDT (-0400)
  Re: Placing label on povray beer bottle  
From: Jerry Anning
Date: 26 Jul 1998 21:23:58
Message: <35BBC8A0.FB0BBC01@dhol.com>
ron hicks wrote:
> 
> Hello,
> 
> I've been raytracing about 3 months and have been polishing my skills
> with CSG construction.
> What I'm trying to do is to place a label on my povray beer bottle...the
> main body of the bottle is a cylinder so I tried using the image_map
> command with map_type set to 2 (for cylinder mapping) and the once
> option. I got the image to map onto the cylinder, but it stretched the
> label all the way around ...so then i tried scaling the x-coordinate of
> the image with no luck....so now I'm looking into creating my cylinder
> with a lathe object to see if handles this situation differently..
> If anyone has any suggestions as how I might get label to map properly
> please let me know.

The trick is transparency.  Create your beer label as a .png with an
alpha channel.  Center the label in the image and create enough
transparent material around it to cover the back part of the bottle.  If
you can't do .png, make a .gif with, say, black for the excess area and
tell POV that that color is transparent.  The 3.02 docs will provide an
example.  The .png with an alpha channel needs no special command.  If
you use .gif, you must find the index of your background color.  Suppose
it is index 0.  Then say:
pigment { image_map { gif "image.gif" filter 0 1.0 } } or say:
pigment { image_map { gif "image.gif" transmit 0 1.0 } } depending on
the kind of transparency you want.  The docs have more detail.

Jerry Anning
cle### [at] dholcom


Post a reply to this message

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