POV-Ray : Newsgroups : povray.newusers : Want to attach one object to another Server Time
25 Jun 2024 03:08:47 EDT (-0400)
  Want to attach one object to another (Message 6 to 15 of 25)  
<<< Previous 5 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Stephen
Subject: Re: Want to attach one object to another
Date: 19 Jun 2013 06:01:07
Message: <51c18163$1@news.povray.org>
On 19/06/2013 9:58 AM, gharryh wrote:
> Maybe i should say warp instead of wrap.
> Als both the cylinder and the label are POV-Ray objects.
> The label is no bitmap image.

Well that is different. You did it the hard way. :-)

I don't know if applying shear transformations would bend the label the 
way you want. My mathematics is not good enough.
You could rebuild the label but use a cylinder as your base. Then rotate 
the characters and symbols so that they are tangential to where they 
intersect the cylinder. Then intersect the characters with a slightly 
larger cylinder to smooth them flush with the label.

-- 
Regards
     Stephen


Post a reply to this message

From: Alain
Subject: Re: Want to attach one object to another
Date: 19 Jun 2013 16:23:15
Message: <51c21333$1@news.povray.org>

> On 19/06/2013 9:58 AM, gharryh wrote:
>> Maybe i should say warp instead of wrap.
>> Als both the cylinder and the label are POV-Ray objects.
>> The label is no bitmap image.
>
> Well that is different. You did it the hard way. :-)
>
> I don't know if applying shear transformations would bend the label the
> way you want. My mathematics is not good enough.
> You could rebuild the label but use a cylinder as your base. Then rotate
> the characters and symbols so that they are tangential to where they
> intersect the cylinder. Then intersect the characters with a slightly
> larger cylinder to smooth them flush with the label.
>
Or use an object pattern of the content of the label for eatch colours. 
Then, you can use a warp{spherical}.


Post a reply to this message

From: Stephen
Subject: Re: Want to attach one object to another
Date: 19 Jun 2013 16:49:00
Message: <51c2193c$1@news.povray.org>
On 19/06/2013 9:23 PM, Alain wrote:
>>
> Or use an object pattern of the content of the label for eatch colours.
> Then, you can use a warp{spherical}.


Nice idea. But this is newusers, Alain.

Could you point to an example? I wouldn't mind seeing how to do this myself.

-- 
Regards
     Stephen


Post a reply to this message

From: Alain
Subject: Re: Want to attach one object to another
Date: 20 Jun 2013 00:38:35
Message: <51c2874b$1@news.povray.org>

> On 19/06/2013 9:23 PM, Alain wrote:
>>>
>> Or use an object pattern of the content of the label for eatch colours.
>> Then, you can use a warp{spherical}.
>
>
> Nice idea. But this is newusers, Alain.
>
> Could you point to an example? I wouldn't mind seeing how to do this
> myself.
>

 From the included documentation for the Windows version, section 
3.4.7.2.5 Object Pattern.

pigment{object{Some_object color InsidePigment color OutsidePigment}}

"Some_object" must be defined in a #declare directive.

This is often used to create a pattern from a text object, but any 
object can be used, both simple or complexe ones. Points that are inside 
the reference object use the first item. Those outside will use the 
second item.

For the warp, it is described in section 3.4.7.5.5.7 Mapping using warps.

Assuming that you created an object named "My_Text" and "My_Logo, it can 
look like this:

pigment{rgb 1} // the background.
pigment{ // a red element, can be some text or anything.
  object{My_Logo color rgb <1,0,0> color rgbt 1

   warp{cylindrical}

   translate 3*y // and move it up 3 units
   once // Ensure that the pigment show only one time
   }
  }
pigment{ // some black element, can be some text.
  object{My_Text color rgb 0 color rgbt 1

   warp{cylindrical}
   once
   }
  }


This is a layered pigment using 3 pigments with some transparency.
You can use any number of layers.

The pigment "rgbt 1" is perfectly transparent showing whatever is under.

The scaling of the X component control the fraction of the cylinder's 
circonference that is covered. Normaly, you should use a value that is 
less than 1. Without that scaling, the pigment get wraped all the way 
around the cylinder.

The scaling of the Y component control the hight. Without it, the 
pigment will be only 1 unit high.

The lower point of the pattern is always a Y=0, and, without once, will 
repeat every unit up and down.

I used simple pigments, but you can use full textures. It will look like:

texture{object{My_Object texture{Texture1} texture{Texture2} }}




Alain


Post a reply to this message

From: gharryh
Subject: Re: Want to attach one object to another
Date: 21 Jun 2013 05:15:01
Message: <web.51c41928c1f827c4520168c30@news.povray.org>
Alain <kua### [at] videotronca> wrote:

> > On 19/06/2013 9:58 AM, gharryh wrote:

> >
> Or use an object pattern of the content of the label for eatch colours.
> Then, you can use a warp{spherical}.
I have made a picture of the label.
Trying the example in the documentation i managed te get it on a cylinder.

object{
    cylinder{<0,0,0><0,70,0>27.5
        pigment{
        image_map {
            jpeg "RE55.jpg"
            map_type 1
            }
        scale<.1,.1,.1>
        }
    }
}

But it seems i cant get it smaller and my knowledge of povray to do a correct
search, not knowing the the correct phrases to use, i cant find the solution.


Post a reply to this message

From: James Holsenback
Subject: Re: Want to attach one object to another
Date: 21 Jun 2013 07:10:26
Message: <51c434a2@news.povray.org>
On 06/21/2013 05:13 AM, gharryh wrote:
> Alain <kua### [at] videotronca> wrote:

>>> On 19/06/2013 9:58 AM, gharryh wrote:
>
>>>
>> Or use an object pattern of the content of the label for eatch colours.
>> Then, you can use a warp{spherical}.
> I have made a picture of the label.
> Trying the example in the documentation i managed te get it on a cylinder.
>
> object{
>      cylinder{<0,0,0><0,70,0>27.5
>          pigment{
>          image_map {
>              jpeg "RE55.jpg"
>              map_type 1
>              }
>          scale<.1,.1,.1>
>          }
>      }
> }
>
> But it seems i cant get it smaller and my knowledge of povray to do a correct
> search, not knowing the the correct phrases to use, i cant find the solution.
>
>
>
>
map_type 1 is spherical mapping ... try map_type 2 (cylindrical) then 
transform (scale, translate)


Post a reply to this message

From: gharryh
Subject: Re: Want to attach one object to another
Date: 21 Jun 2013 07:45:00
Message: <web.51c43b8ec1f827c4520168c30@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
        }
    }
}


Post a reply to this message

From: James Holsenback
Subject: Re: Want to attach one object to another
Date: 21 Jun 2013 08:25:23
Message: <51c44633$1@news.povray.org>
On 06/21/2013 07:39 AM, gharryh wrote:
> 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
>          }
>      }
> }
>
>
>
then maybe the once keyword isn't appropriate


Post a reply to this message

From: Stephen
Subject: Re: Want to attach one object to another
Date: 21 Jun 2013 09:47:16
Message: <51c45964@news.povray.org>
On 21/06/2013 1:25 PM, James Holsenback wrote:
> then maybe the once keyword isn't appropriate

Taking into account that the label does not use the full circumference 
of a cylinder. I created a CSG intersection and tried to map that. I 
found it very difficult to get the scaling right. My usual method of 
doing this is to pad the outside of the image with a transparent colour 
so that there are no transformations to worry about. Only working out 
the size of the image within an image. I've never been happy with doing 
that, though.

So I used a bi-cubic patch and planer mapping, that worked better.

I would like to see an example using cylindrical mapping so that image 
was fully visible on only part of the surface.

-- 
Regards
     Stephen


Post a reply to this message

From: Le Forgeron
Subject: Re: Want to attach one object to another
Date: 21 Jun 2013 09:52:36
Message: <51c45aa4$1@news.povray.org>
Le 21/06/2013 13:39, gharryh nous fit lire :
> 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
>         }
>     }
> }
> 
> 
> 

Try that:

cylinder{<0,0,0><0,70,0>dia/2+.25
	pigment{
		image_map {
                jpeg "RE55s.jpg"
        once
	interpolate 4
		}
		scale <1/3,24,1/3>  // labelheight
  warp { cylindrical orientation z dist_exp 0  }
	}

}

Or make RE55s.jpg three time it's current width, with a neutral colour
for the extension.


Post a reply to this message

<<< Previous 5 Messages Goto Latest 10 Messages Next 10 Messages >>>

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