POV-Ray : Newsgroups : povray.newusers : Image Mapping a Cylinder? : Re: Image Mapping a Cylinder? Server Time
6 Sep 2024 06:23:20 EDT (-0400)
  Re: Image Mapping a Cylinder?  
From: Margus Ramst
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.