POV-Ray : Newsgroups : povray.newusers : *repeated* texture map (image or checkerboard) on cylinder? : Re: *repeated* texture map (image or checkerboard) on cylinder? Server Time
2 Nov 2024 15:24:02 EDT (-0400)
  Re: *repeated* texture map (image or checkerboard) on cylinder?  
From: Richard
Date: 17 Dec 2003 19:40:01
Message: <web.3fe0f70041a6a46abcb589a30@news.povray.org>
Mike Williams wrote:
>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
>


Thanks for the suggestion.  But uv_mapping doesn't seem to work for
cylinders!
Here is the closest I could get, using "lathe" objects:

lathe {
  linear_spline
  2, <3, 0>, <3, 5>    // radius 3, height 5
  uv_mapping
  texture {
    pigment {
      image_map {
        gif "myimage.gif"
        interpolate 2
      }
    }
    finish { ambient 1.0 }
    scale <0.50, 1.0>  // make texture map isotropic on surface
                       // needed because both inside and outside of cylinder
                       // are painted
  }
}

I tried a "sor" object, but couldn't get it to work.  I don't understand
what the first and last values do in the sor.  Does anyone know how to
draw a cylinder, without end covers?

Thanks again,
  Richard


Post a reply to this message

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