POV-Ray : Newsgroups : povray.general : How to adjust image_map? : Re: How to adjust image_map? Server Time
18 Apr 2024 21:01:07 EDT (-0400)
  Re: How to adjust image_map?  
From: Alain Martel
Date: 20 Feb 2020 16:02:47
Message: <5e4ef3f7$1@news.povray.org>
Le 2020-02-20 à 04:39, Kima a écrit :
> I wrap an image over a lathe by
> 
> lathe{
>    cubic_spline 8,
>       < 0.00, 0.00>,
>       < 0.60, 0.00>,
>       < 0.72, 0.44>,
>       < 0.31, 0.93>,
>       < 0.49, 1.26>,
>       < 0.48, 1.35>,
>       < 0.43, 1.56>,
>       < 0.16, 1.60>
>       texture{
>           pigment{
>               color rgb<1,0,0>
>           }
>       }
>       texture{
>           pigment{
>               image_map{
>                   png "image.png" map_type 2 interpolate 4 once
> 
>               }
> 
>           }
>       }
> }
> 
> I have two problems:
> 
> 1. image_map put the image on the object from the bottom (from south to north).
> Thus, if the image height is not enough to cover the object, it is always the
> top part, which is missing.

You need to scale the image vertically to the height of the object.
scale<1, Object_Height, 1>

> 
> How can I put the image from top to bottom or even on the middle (with respect
> to the y-axis)?

You can use : scale<1, -1, 1> or scale<1, -Object_Height, 1>
This will flip the image vertically.
scale<-1, 1, 1> will reverse the direction of the wrap.
scale<1, 1, -1> have no effect.

> 
> I can move the image by translate<0,0.5,0>, but it is not practical as I have to
> find the image height on the object.

By default, the image height's is one unit. The bottom is at zero and 
the top at 1.
If the image is smaller than the object, and you don't use «once», then, 
it will be visible multiple times.

> 
> We need something like Center_Object, but image_map is not an object.
> 
> 2. map_type 2 makes a full wrap cylindrically. How can I make image_map half
> wrap or to a custom degree (instead of 360)?

Scale the image along the X direction. For a half wrap, use
scale<0.5, 1, 1>

For a specific number of degree, it's :

scale<Degree/360, 1, 1>

> 
> By scale, we can control the image over the y-axis, but the scale on the x-axis
> has no effect.
> 
>


Post a reply to this message

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