POV-Ray : Newsgroups : povray.newusers : Want to attach one object to another Server Time
25 Jun 2024 21:02:20 EDT (-0400)
  Want to attach one object to another (Message 21 to 25 of 25)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Alain
Subject: Re: Want to attach one object to another
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

From: Alain
Subject: Re: Want to attach one object to another
Date: 21 Jun 2013 14:43:49
Message: <51c49ee5$1@news.povray.org>

> On 21/06/2013 4:56 PM, James Holsenback wrote:
>>
>> yeah ... i'm curious why the orig poster got his example to work using
>> planar map_type and spherical warp. there MUST be some other unknowns
>> going on. many moons ago i placed a label on cylinder shape (horizontal
>> orientation) using method above ... iirc i used map_type 2 and some
>> uneven scaling, with translate
>
> Maybe the spherical warp undoes the distortion of using planer mapping
> on a cylinder.
>

On the contrary, it INTRODUCE some distortion. As you move away from the 
X-Z plane, the image get stretched.




Alain


Post a reply to this message

From: Stephen
Subject: Re: Want to attach one object to another
Date: 21 Jun 2013 15:11:50
Message: <51c4a576$1@news.povray.org>
On 21/06/2013 7:44 PM, Alain wrote:
>> Maybe the spherical warp undoes the distortion of using planer mapping
>> on a cylinder.
>>
>
> On the contrary, it INTRODUCE some distortion. As you move away from the
> X-Z plane, the image get stretched.

I thought that something like that might be the case. So Jim's question 
still stands.

-- 
Regards
     Stephen


Post a reply to this message

From: Alain
Subject: Re: Want to attach one object to another
Date: 22 Jun 2013 15:41:57
Message: <51c5fe05$1@news.povray.org>

> On 21/06/2013 7:44 PM, Alain wrote:
>>> Maybe the spherical warp undoes the distortion of using planer mapping
>>> on a cylinder.
>>>
>>
>> On the contrary, it INTRODUCE some distortion. As you move away from the
>> X-Z plane, the image get stretched.
>
> I thought that something like that might be the case. So Jim's question
> still stands.
>

If the sylinder is short, the distortion is not to apparent. Also, in 
*some* cases, a spherical mapping can be used on a cylinder for good effect.

On this cylinder, it's OK...

cylinder{y, -y, 1 }

Using spherical mapping, the cap get a recognisable image, but the image 
is distorted. The cylinder been short, the distortion is still low 
enough to not been realy noticeable.

Using the correct cylindrical mapping, the caps will only show a radial 
pattern corresponding to the top layer of pixels from the image, but the 
image on the sides is distortion free.



Alain


Post a reply to this message

From: Bald Eagle
Subject: Re: Want to attach one object to another
Date: 31 Jul 2013 00:35:01
Message: <web.51f892d4c1f827c473fc9ebb0@news.povray.org>
I haven't used this yet:

http://lib.povray.org/searchcollection/index2.php?objectName=Labeller&contributorTag=chrisb

A solution?


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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