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:25:01 EDT (-0400)
  Re: *repeated* texture map (image or checkerboard) on cylinder?  
From:
Date: 18 Dec 2003 06:12:46
Message: <3fe18bae@news.povray.org>
// Hi Richard,
//
// here is a complete scene showing a scalable
// cylindrical map using a warp.
//
//   Sputnik


// -F +A0.1 +AM2 +R2 +W512 +H384

#declare High   = 5;   // number of stacked images
#declare Around =10;   // number of images around a circumference

#declare Width  = 0.4; // width of a single image-patch
#declare Height = 0.3; // height of a single image-patch

#declare MyRadius = 0.4; // (see below)

#declare Radius = Around*Width/2/pi; // calculate Radius from circumference
#declare Length = High*Height; // calculate Length

cylinder { 0, Length*y, Radius
  pigment {
    image_map {
      png "C:\Programs\POV-Ray for Windows v3.5\include\bumpmap_.png"
      //once // only 1 image with lower left corner at Radius*x
      map_type 0 // planar map!; wrapping is done by warp
      interpolate 2
      }
    // checker {...} instead of image_map {...} works too
    // put Around X High images onto 1 X Length
    scale <1/Around, Height, 1>
    warp {
      // wrap around a cylinder: 1 X Length -> circumference X Length
      cylindrical
      // look onto the image's xy-plane
      orientation z
      dist_exp 0
      }
    }
  finish { ambient 1 }
  //scale MyRadius/Radius // makes a cylinder with radius=MyRadius (and
                          // proportionally corrected length)
  }

// never without checkered plane and sphere ...
plane { y, -0.01 pigment { checker } finish { ambient 1 } }
sphere { Radius*x, Radius/10
  pigment { color red 2 }
  finish { ambient 1 }
  //scale MyRadius/Radius // corresponds to the cylinder's scale
  }

camera { location 0.4*<2, 3, -4> look_at 0 translate Length/2*y }


Post a reply to this message

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