POV-Ray : Newsgroups : povray.newusers : Want to attach one object to another : Re: Want to attach one object to another Server Time
1 Jun 2024 14:33:52 EDT (-0400)
  Re: Want to attach one object to another  
From: Alain
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

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