POV-Ray : Newsgroups : povray.newusers : *repeated* texture map (image or checkerboard) on cylinder? : Re: *repeated* texture map (image or checkerboard) on cylinder? Server Time
30 Jul 2024 16:17:38 EDT (-0400)
  Re: *repeated* texture map (image or checkerboard) on cylinder?  
From: Mike Williams
Date: 17 Dec 2003 03:01:27
Message: <y3YfSDA$zA4$EwhO@econym.demon.co.uk>
Wasn't it Richard who wrote:
>I want to map a pattern, either a checkerboard texture, or an input image,
>onto a cylinder.  What I want to do is take a square image and repeatedly
>"paint" or "tile" it on the cylinder.
>
>I've tried this:
>
>cylinder { <0, -1, 0>, <0 1 0>, 1
>  texture {
>    pigment {
>      image_map { gif "myimage.gif" map_type 2 interpolate 2 }
>    }
>  }
>}
>
>but how do I make the aspect ratio so that a 1x1 patch on the surface of
>the cylinder gets the image I input?

In the case of a cylinder, you can use uv_mapping

cylinder { <0, -1, 0>, <0 1 0>, 1
  uv_mapping
  texture {
    pigment {
      image_map { 
        gif "myimage.gif"
        interpolate 2 
      }
    }
  }
}


>
>Also, can I make default textures, like "checker" paint in the same way?

And uv_mapping also works for any texture

cylinder { <0, -1, 0>, <0 1 0>, 1
  uv_mapping
  pigment {
    checker scale 0.5
  }
}

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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