POV-Ray : Newsgroups : povray.general : Spherical Image Map : Re: Spherical Image Map Server Time
31 Jul 2024 04:22:20 EDT (-0400)
  Re: Spherical Image Map  
From: Trevor G Quayle
Date: 18 Oct 2007 15:35:01
Message: <web.4717b50d4a0b5ca0c150d4c10@news.povray.org>
Leroy <lrw### [at] joplincom> wrote:
> Kirk Andrews wrote:
> > When using the spherical or cylindrical projection of an image map, it wraps
> > the image once around the object.  Is there a way to make it wrap multiple
> > times?  For example, if my image has the letter "M", can I make it wrap 8
> > "M"s around a cylinder?  I've tried scaling, frequency, converting to a
> > function, etc., but I can't seem to find a way to do it without simply
> > editing the image.
> >
> > Thanks
> >
> >
> try this:
>
>   sphere {
>       0,1
>       pigment {
>         image_map{tga "Your image.tga"}
>         scale .4 //play with this
>         warp {
>           spherical
>           orientation z
>           dist_exp 1//play with this also
>         }
>       }
>     }

Leroy <lrw### [at] joplincom> wrote:
> Kirk Andrews wrote:
> > When using the spherical or cylindrical projection of an image map, it wraps
> > the image once around the object.  Is there a way to make it wrap multiple
> > times?  For example, if my image has the letter "M", can I make it wrap 8
> > "M"s around a cylinder?  I've tried scaling, frequency, converting to a
> > function, etc., but I can't seem to find a way to do it without simply
> > editing the image.
> >
> > Thanks
> >
> >
> try this:
>
>   sphere {
>       0,1
>       pigment {
>         image_map{tga "Your image.tga"}
>         scale .4 //play with this
>         warp {
>           spherical
>           orientation z
>           dist_exp 1//play with this also
>         }
>       }
>     }

Exactly as Leroy has put it.
To clarify:
iamge_maps get mapped from 0,0 to 1,1 on the x-y plane and repeat (unless
'once' keyword is used).  When warping to a cylindrical or spherical
mapping, the pigment (or in this case image_map pigment) is read from 0,0
to 1,1 on the x-y plane and converted to cylindrical mapping.  So to get
what you want to do, after invoking the image_map in the pigment, scale the
the x-axis direction down by the number of repeats you want.  Scaling the
z-axis does nothing, and scaling the y-axis will just require you to likely
have to rescale the y-axis again to get it mapped to the height you want, so
it's best to leave y and z scales at 1.

pigment{image_map {jpeg "image.jpg"} scale <1/n,1,1> warp{cylindrical}}

Where n=the number of times you want it to repeat.

The key is to scale AFTER the image_map, but BEFORE the warp.

This is applicable to repeating around the cylinder or sphere.  If you want
to also repeat up and down on t either, just add the applicable scale to
the y-axis.

-tgq


Post a reply to this message

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