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:01 EDT (-0400)
  Re: *repeated* texture map (image or checkerboard) on cylinder?  
From: Richard
Date: 18 Dec 2003 13:35:02
Message: <web.3fe1f2a841a6a46a5541bd820@news.povray.org>
Mike Williams wrote:
>Wasn't it Richard who wrote:
>
>>Thanks for the suggestion.  But uv_mapping doesn't seem to work for
>>cylinders!
>
>It works for me.
>
>#declare SCALE=<3,2.5,3>;
>
>cylinder { <0, -1, 0>, <0 1 0>, 1
>  open
>  uv_mapping
>  texture {
>    pigment {
>      image_map {
>        gif "myimage.gif"
>        interpolate 2
>      }
>    }
>    finish { ambient 1.0 }
>    scale SCALE*2  // make texture map isotropic on surface
>                   // needed because both inside and outside of cylinder
>                   // are painted
>  }
>  scale SCALE // radius 3, height 5
>  translate  <6,2.5,0>
>}
>
>>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?
>
>The start and end points of a SOR are a bit like the extra points you
>need for a cubic_spline. I don't think that it's documented what sort of
>spline is actually used for generating a SOR, but it's definitely not a
>linear spline. To create the appearance of a linear spline with a SOR,
>you can simply double up the end points.
>
>To remove the end covers, use the "open" keyword, just like with
>"cylinder".
>
>sor {
>  4, <3, 0>,<3, 0>,<3, 5>,<3, 5> open   // 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
>  }
>}
>
>Mike Williams
>Gentleman of Leisure
>


Thanks for all the help (to Mike and others).

Here is an image, but it doesn't map checkers _uniformly_ over the surface
of
the cylinder.  Is this a problem with my version (3.5)?

// BEGIN
camera {
  angle 60
  location <20 20 -10>
  look_at <0, 0, 0>
}

cylinder { <0, -5, 0>, <0 5 0>, 3
  open
  uv_mapping
  pigment {
    checker scale 0.5
  }
  finish { ambient 1.0 }
}
// END

Otherwise I'll use "sor" or "lathe", or the "warp" function the other
poster suggested.

Thanks,
  Richard


Post a reply to this message

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