POV-Ray : Newsgroups : povray.newusers : Image Mapping a Cylinder? Server Time
29 Nov 2024 08:41:34 EST (-0500)
  Image Mapping a Cylinder? (Message 1 to 3 of 3)  
From: Prez Midnite
Subject: Image Mapping a Cylinder?
Date: 12 Dec 1998 16:23:10
Message: <3672DEB6.8D9F3F07@NOSPAM.disinfo.net>
Alright, I'm stuck... Can anyone give me advice [or code =) ] on how to
wrap an image map around a cylinder, like a label on a can? It seems
like it should be easy, but I just can't get it to look right. I'm sure
it'll take some math to get the scaling right. The image map is 384 x
1400 and the cylinder is whatever size it needs to be to let the image
map keep it's appearance.


Prez Midnite............... out.
e-mail:prezmid at disinfo dot net
http://westwood.fortunecity.com/sander/73/index.html
"Help me, povray.newusers. You're my only hope..." ;)


Post a reply to this message

From: Spock
Subject: Re: Image Mapping a Cylinder?
Date: 12 Dec 1998 17:38:05
Message: <3672f04d.0@news.povray.org>
This fragment worked when I put a label on a wine bottle...

  texture { //the label
   pigment {
    image_map {
     gif "label.gif"
     interpolate 2
     once
     map_type 2
     transmit 255,1
    }
    scale .9
    translate <0,.3,0>
    rotate <0,-90,0>
   }
  }

Prez Midnite wrote in message <3672DEB6.8D9F3F07@NOSPAM.disinfo.net>...
>Alright, I'm stuck...


Post a reply to this message

From: Margus Ramst
Subject: Re: Image Mapping a Cylinder?
Date: 12 Dec 1998 18:04:54
Message: <3672F3FD.8D359BEF@peak.edu.ee>
If keeping the right aspect ratio is what you need, use this calculation:

X - width of the image_map
Y - height of the image_map
r - radius

r = X / Y / (2 * pi)

This gives you an appropriate radius for a 1 unit high cylinder and full 360
degree wrapping. If you want, let's say, specific X degrees wrapping, multiply
the above by 360/X
Or use a macro:

#macro cyl_wrap(X,Y,Degrees)
	(X / Y / (2 * pi) * (360 / Degrees))
#end

Use this for the cylinder's radius

I hope this helps

Margus

Prez Midnite wrote:
> 
> Alright, I'm stuck... Can anyone give me advice [or code =) ] on how to
> wrap an image map around a cylinder, like a label on a can? It seems
> like it should be easy, but I just can't get it to look right. I'm sure
> it'll take some math to get the scaling right. The image map is 384 x
> 1400 and the cylinder is whatever size it needs to be to let the image
> map keep it's appearance.
> 
> Prez Midnite............... out.
> e-mail:prezmid at disinfo dot net
> http://westwood.fortunecity.com/sander/73/index.html
> "Help me, povray.newusers. You're my only hope..." ;)


Post a reply to this message

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