POV-Ray : Newsgroups : povray.general : clone/duplicate of a union Server Time
28 Mar 2024 04:28:03 EDT (-0400)
  clone/duplicate of a union (Message 1 to 7 of 7)  
From: Kima
Subject: clone/duplicate of a union
Date: 25 May 2018 08:20:01
Message: <web.5b07fe921258309a3ce674f0@news.povray.org>
It is probably a ridiculous question, but imagine we have created a union as

#declare obj_u1 =
    union {
        obj1
        obj2
    }

how can we create clones of obj_u1 and apply different transformations?

For example, how can we transform three independent copies of obj_u1 as

translate obj_u1
scale obj_u1
rotate obj_u1


Post a reply to this message

From: Stephen
Subject: Re: clone/duplicate of a union
Date: 25 May 2018 09:49:24
Message: <5b081464$1@news.povray.org>
On 25/05/2018 13:16, Kima wrote:
> It is probably a ridiculous question, but imagine we have created a union as
> 
> #declare obj_u1 =
>      union {
>          obj1
>          obj2
>      }
> 
> how can we create clones of obj_u1 and apply different transformations?
> 
> For example, how can we transform three independent copies of obj_u1 as
> 
> translate obj_u1
> scale obj_u1
> rotate obj_u1
> 
> 
Once you have declared it. Call it by using:

object{ obj_u1

	rotate <a,b,c>
	scale <l,m,n>
	translate <x,y,z>
	}

Repeat as many times as you want with different transformations and 
textures.


-- 

Regards
     Stephen


Post a reply to this message

From: Bald Eagle
Subject: Re: clone/duplicate of a union
Date: 25 May 2018 12:50:01
Message: <web.5b083e9ba6a9132710874a080@news.povray.org>
"Kima" <nomail@nomail> wrote:
> It is probably a ridiculous question, but imagine we have created a union as

POV-Ray has a somewhat steep learning curve, so these things aren't really
ridiculous.

> #declare obj_u1 =
>     union {
>         obj1
>         obj2
>     }
>
> how can we create clones of obj_u1 and apply different transformations?

> For example, how can we transform three independent copies of obj_u1 as
>
> translate obj_u1
> scale obj_u1
> rotate obj_u1

What you want to do is use the
object {} "directive" or whatever this type of SDL command is properly called.

So, assuming you've declared values for x1, y1, and z1, you could use the
following structures:

object {obj_u1 translate <x1, y1, z1>}
object {obj_u1 translate x*10}

object {obj_u1 scale <x1, y1, z1>}
object {obj_u1 scale 3}

object {obj_u1 rotate <x1, y1, z1>}
object {obj_u1 rotate y*degrees}


Post a reply to this message

From: Stephen
Subject: Re: clone/duplicate of a union
Date: 25 May 2018 15:30:43
Message: <5b086463$1@news.povray.org>
On 25/05/2018 17:49, Bald Eagle wrote:
> POV-Ray has a somewhat steep learning curve, so these things aren't really
> ridiculous.

And there are no stupid questions only stupid answers.

-- 

Regards
     Stephen


Post a reply to this message

From: Jim Holsenback
Subject: Re: clone/duplicate of a union
Date: 25 May 2018 16:12:07
Message: <5b086e17$1@news.povray.org>
On 05/25/2018 03:30 PM, Stephen wrote:
> On 25/05/2018 17:49, Bald Eagle wrote:
>> POV-Ray has a somewhat steep learning curve, so these things aren't 
>> really
>> ridiculous.
> 
> And there are no stupid questions only stupid answers.
> 
well i'm glad to see that i'm not the only cranky old man here...sounds 
like something i might have said


Post a reply to this message

From: Alain
Subject: Re: clone/duplicate of a union
Date: 25 May 2018 16:16:18
Message: <5b086f12@news.povray.org>
Le 18-05-25 à 08:16, Kima a écrit :
> It is probably a ridiculous question, but imagine we have created a union as
> 
> #declare obj_u1 =
>      union {
>          obj1
>          obj2
>      }
> 
> how can we create clones of obj_u1 and apply different transformations?
> 
> For example, how can we transform three independent copies of obj_u1 as
> 
> translate obj_u1
> scale obj_u1
> rotate obj_u1
> 
> 

Very simple.
You can simply place the object multiple times into your scene :
object{obj_u1 translate SomeTranslation}
object{obj_u1 scale SomeScalling}
object{obj_u1 rotate SomeRotation}

Or, you can make transformed copies :
#declare obj_t1 = object{obj_u1 translate SomeTranslation}
#declare obj_t2 = object{obj_u1 scale SomeScalling}
#declare obj_t3 = object{obj_u1 rotate SomeRotation}


Post a reply to this message

From: Stephen
Subject: Re: clone/duplicate of a union
Date: 25 May 2018 16:41:42
Message: <5b087506$1@news.povray.org>
On 25/05/2018 21:12, Jim Holsenback wrote:
> On 05/25/2018 03:30 PM, Stephen wrote:
>> On 25/05/2018 17:49, Bald Eagle wrote:
>>> POV-Ray has a somewhat steep learning curve, so these things aren't 
>>> really
>>> ridiculous.
>>
>> And there are no stupid questions only stupid answers.
>>
> well i'm glad to see that i'm not the only cranky old man here...sounds 
> like something i might have said

:-)
And where is Shelly when you need her. ;-)

-- 

Regards
     Stephen


Post a reply to this message

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