POV-Ray : Newsgroups : povray.general : Placing label on povray beer bottle Server Time
16 Nov 2024 11:15:10 EST (-0500)
  Placing label on povray beer bottle (Message 1 to 7 of 7)  
From: ron hicks
Subject: Placing label on povray beer bottle
Date: 26 Jul 1998 20:08:32
Message: <35B909CC.4BA4F43D@hotmail.com>
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.

Best Regards,

Ron Hicks
www.geocities.com/SoHo/1006
sig### [at] hotmailcom


Post a reply to this message

From: Jerry Anning
Subject: Re: Placing label on povray beer bottle
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

From: Dan Connelly
Subject: Re: Placing label on povray beer bottle
Date: 26 Jul 1998 21:48:10
Message: <35BBCE52.B907933F@flash.net>
There are several options.  The one I use is to
place borders at the sides of the label so when
it stretches around, the letters will remain on one
side. You can then assign transparency to that
part of the image so the underlying bottle appears.

You'll need to think about how to scale the image
to maintain proper aspect ratio.  I like using
labels of aspect ratio x:y :: 2 pi:1 to make
this easy.

Also you probably want to use "once" in the texture
specification to prevent it from tiling the 
label along the y-axis.  Also don't forget
"interpolate 2" to save yourself from aliasing.

Dan

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.
> 
> Best Regards,
> 
> Ron Hicks
> www.geocities.com/SoHo/1006
> sig### [at] hotmailcom

-- 
http://www.flash.net/~djconnel/


Post a reply to this message

From: Peter Popov
Subject: Re: Placing label on povray beer bottle
Date: 30 Jul 1998 22:06:53
Message: <35c118ad.0@news.povray.org>
Here's what you might do.

If your bottle body is a cylider, just use the map_type 2 (as you did).
Since POV stretches it all the way along a full revolution, you will need to
provide extra space in your image_map file outside the label. Experiment
with sizes, but keep aspect in mind. Also, use either PNG or GIF (or TGA?)
so that you use transparency (refer to the docs.)

In the more complex case (like the one I did) the bottle is a CSG
difference. It looks more realistic. However the image maps on the outside
*as well as* on the inside. So you'll need to have a separate label object
just a tiny bit larger in radius than the bottle and also infiinetely thin
(remember clipped_by?)

Hope this helps.

Regards,

--Peter

ron hicks wrote in message <35B909CC.4BA4F43D@hotmail.com>...
>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.
>
>Best Regards,
>
>Ron Hicks
>www.geocities.com/SoHo/1006
>sig### [at] hotmailcom
>
>


Post a reply to this message

From: ron hicks
Subject: Re: Placing label on povray beer bottle
Date: 31 Jul 1998 03:18:39
Message: <35BDCD23.89F57B55@hotmail.com>
Dan Connelly wrote:

> There are several options.  The one I use is to
> place borders at the sides of the label so when
> it stretches around, the letters will remain on one
> side. You can then assign transparency to that
> part of the image so the underlying bottle appears.
>
> You'll need to think about how to scale the image
> to maintain proper aspect ratio.  I like using
> labels of aspect ratio x:y :: 2 pi:1 to make
> this easy.
>
> Also you probably want to use "once" in the texture
> specification to prevent it from tiling the
> label along the y-axis.  Also don't forget
> "interpolate 2" to save yourself from aliasing.
>
> Dan
>
> 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.
> >
> > Best Regards,
> >
> > Ron Hicks
> > www.geocities.com/SoHo/1006
> > sig### [at] hotmailcom
>
> --
> http://www.flash.net/~djconnel/

  Dan-

I tried the tips you suggested including the regarding aspect ratio. I also
looked into the docs regarding transparency for the border. Now my problem is
setting the 'palette'
entry in the filter or transmit option. I created the label in PSP 5.0 and rgb
components are assigned a number from  0 to 255, which does'nt correspond to
the way povray assigns color components ( as far as I know ) so there are
really two things I don't understand.
1) How do I correlate PSP colors with povray colors?
2) What is required in povray's 'pallete' entry for the filter/transmit
statement regarding image maps?

One other thing I would like to note regarding the aspect ratio of the image;
it seems to me that an aspect ration of pi : 1 would make the label only
stretch 'halfway' round rather than 2pi or am I going off the deep end with
this presumption%}

Best regards,

Ron Hicks
sig### [at] hotmailcom
www.geocities.com/SoHo/1006


Post a reply to this message

From: K  Tyler
Subject: Re: Placing label on povray beer bottle
Date: 31 Jul 1998 04:16:55
Message: <35C16126.DE562776@pacbell.net>
ron hicks wrote:

>   Dan-
>
> I tried the tips you suggested including the regarding aspect ratio. I also
> looked into the docs regarding transparency for the border. Now my problem is
> setting the 'palette'
> entry in the filter or transmit option. I created the label in PSP 5.0 and rgb
> components are assigned a number from  0 to 255, which does'nt correspond to
> the way povray assigns color components ( as far as I know ) so there are
> really two things I don't understand.
> 1) How do I correlate PSP colors with povray colors?
> 2) What is required in povray's 'pallete' entry for the filter/transmit
> statement regarding image maps?
>
> One other thing I would like to note regarding the aspect ratio of the image;
> it seems to me that an aspect ration of pi : 1 would make the label only
> stretch 'halfway' round rather than 2pi or am I going off the deep end with
> this presumption%}
>
> Best regards,
>
> Ron Hicks
> sig### [at] hotmailcom
> www.geocities.com/SoHo/1006

    Take a look at the tread over on c.c.g.r. about cylindrical mapping.
Vercurse mentions using 'transmit 255,1'  when the default background
is white.

Regaurds

K.Tyler


Post a reply to this message

From: Dan Connelly
Subject: Re: Placing label on povray beer bottle
Date: 31 Jul 1998 20:02:12
Message: <35C24D07.F91FFE28@flash.net>
Sorry for the delay in replying...

The key in PSP 5.0 is to "colors->decrease color depth" to 256 colors.
Then "colors->edit palette" to see which color index corresponds
to the color which is the background -- colors are numbered
starting with 0 and going to 255.  Or, if your label
is simpler, you can reduce the colors to 16.  Just make sure
your background color is unique (to avoid confusion).

Then use the "transmit" option in the image_map statement to
set the transmission of the background color to 1.

>> labels of aspect ratio x:y :: 2 pi:1 to make

> One other thing I would like to note regarding the aspect ratio of the image;
> it seems to me that an aspect ration of pi : 1 would make the label only
> stretch 'halfway' round rather than 2pi or am I going off the deep end with
> this presumption%}

Correct -- I think you missed the "2" in my note.

Dan

-- 
http://www.flash.net/~djconnel/


Post a reply to this message

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