POV-Ray : Newsgroups : povray.general : clone/duplicate of a union : Re: clone/duplicate of a union Server Time
18 Apr 2024 01:36:52 EDT (-0400)
  Re: clone/duplicate of a union  
From: Bald Eagle
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

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