POV-Ray : Newsgroups : povray.newusers : Want to attach one object to another : Re: Want to attach one object to another Server Time
25 Jun 2024 03:17:00 EDT (-0400)
  Re: Want to attach one object to another  
From: Alain
Date: 21 Jun 2013 14:40:45
Message: <51c49e2d$1@news.povray.org>

> I changed a bit to get this image:
> http://www.harry-arends.nl/werkgroep/images/WarpText.png
> But as can be seen it warpt totatly around. The height is correct but it should
> cover only 1/3rd of the cylinder.
>
> #declare label =
> object{
>      cylinder{<0,0,0><0,70,0>dia/2+.25
>          pigment{
>              image_map {
>                  jpeg "RE55s.jpg"
>                  map_type 2
>                  once
>                  interpolate 4
>              }
>              scale <1,24,1>  // labelheight
>          }
>      }
> }
>
>
>

map_type 1 and map_type 2 always cover the full cyrconference. NO 
scaling can change that.

Scaling can only change the vertical extent.

For what you want, a warp is required. Your sample becomes this:

#declare label =
object{
     cylinder{<0,0,0><0,70,0>dia/2+.025
         pigment{
             image_map {
                 jpeg "RE55s.jpg"
		scale<1/3,1,1>
                 warp{cylindrical}
                 once
                 interpolate 4
             }
             scale <1,24,1>  // labelheight
         }
     }
}


The scale ensure that the image will cover 1/3 or the circonference.
As it is, the label will be 1 unit high. Adjust the Y component to get 
the desired hight.
You can use scale<Angle/360, Hight, 1> to get exact controll.


"once" is required. Without it, the image will get repeated 3 times 
around the cylinder, and all the way up and down the cylinder. In this 
case, 2.9 times.


Alain


Post a reply to this message

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