POV-Ray : Newsgroups : povray.animations : grouping objects for transforms Server Time: 9 Dec 2018 21:47:08 GMT
  grouping objects for transforms (Message 1 to 10 of 20)  
Goto Latest 10 Messages Next 10 Messages >>>
From: Klewlis
Subject: grouping objects for transforms
Date: 5 Feb 2017 14:20:01
Message: <web.5897336bee778495f9209890@news.povray.org>
For my animation, I want to place several objects in my scene individually,
group them somehow and perform transform operations on the entire group.
#declare groups the objects, but then I have to insert all objects as one unit.
Is there a way to create a group as you place the items in one at a time?

Something like:

#group {eastwall}

object { LongPlate
    rotate z*90
    rotate y*90
    rotate x*-90 }

object { LongPlate
    rotate z*90
    rotate y*90
    translate z*94.125
    rotate x*-90 }

object { ShortPlate
    rotate z*90
    rotate y*90
    translate <3.5, 0, 95.625>
    rotate x*-90 }

#for (i, 1.5, 241.5, 16)
    object {Stud
        rotate z*90
        translate <i, 0, 1.5>
        rotate x*-90 }
#end

#endgroup

translate {eastwall} x*-90

then I would use a clock to place each item individually then transform the
entire group.


Post a reply to this message

From: clipka
Subject: Re: grouping objects for transforms
Date: 5 Feb 2017 16:47:22
Message: <5897571a$1@news.povray.org>
Am 05.02.2017 um 15:15 schrieb Klewlis:
> For my animation, I want to place several objects in my scene individually,
> group them somehow and perform transform operations on the entire group.
> #declare groups the objects, but then I have to insert all objects as one unit.
> Is there a way to create a group as you place the items in one at a time?

Nope.

Depending on what exactly you want to do, you might want to try
pre-defining the particular transform, and then applying it to multiple
objects:

    #declare MyTrans = transform {
      rotate x*-90
      scale <2,3,4>
    }
    ...

    object { Foo
      transform { MyTrans }
    }

    object { Bar
      transform { MyTrans }
    }

Note however that this probably doesn't give the intended result if one
of the objects is part of a CSG compound that itself is subject to some
transformation.


Post a reply to this message

From: Stephen
Subject: Re: grouping objects for transforms
Date: 5 Feb 2017 17:12:11
Message: <58975ceb$1@news.povray.org>
On 2/5/2017 2:15 PM, Klewlis wrote:
> For my animation, I want to place several objects in my scene individually,
> group them somehow and perform transform operations on the entire group.
> #declare groups the objects, but then I have to insert all objects as one unit.
> Is there a way to create a group as you place the items in one at a time?
>
> Something like:
>
> #group {eastwall}
>
> object { LongPlate
>      rotate z*90
>      rotate y*90
>      rotate x*-90 }
>
> object { LongPlate
>      rotate z*90
>      rotate y*90
>      translate z*94.125
>      rotate x*-90 }
>
> object { ShortPlate
>      rotate z*90
>      rotate y*90
>      translate <3.5, 0, 95.625>
>      rotate x*-90 }
>
> #for (i, 1.5, 241.5, 16)
>      object {Stud
>          rotate z*90
>          translate <i, 0, 1.5>
>          rotate x*-90 }
> #end
>
> #endgroup
>
> translate {eastwall} x*-90
>
> then I would use a clock to place each item individually then transform the
> entire group.
>
>

Use union 2.2.3.2 CSG Union

union{		 // Start of union


 > object { LongPlate
 >      rotate z*90
 >      rotate y*90
 >      rotate x*-90 }
 >
 > object { LongPlate
 >      rotate z*90
 >      rotate y*90
 >      translate z*94.125
 >      rotate x*-90 }
 >
 > object { ShortPlate
 >      rotate z*90
 >      rotate y*90
 >      translate <3.5, 0, 95.625>
 >      rotate x*-90 }
 >
 > #for (i, 1.5, 241.5, 16)
 >      object {Stud
 >          rotate z*90
 >          translate <i, 0, 1.5>
 >          rotate x*-90 }
 > #end

 > translate {eastwall} x*-90

}  // End of union

-- 

Regards
     Stephen


Post a reply to this message

From: Klewlis
Subject: Re: grouping objects for transforms
Date: 5 Feb 2017 18:30:00
Message: <web.58976e4d6098c6675f9209890@news.povray.org>
I want to build the wall laying down on the "concrete slab" then stand it and
move it into place as one unit.  I am currently building the wall standing up
which is not very realistic.


Post a reply to this message

From: Klewlis
Subject: Re: grouping objects for transforms
Date: 5 Feb 2017 18:35:01
Message: <web.58976f276098c6675f9209890@news.povray.org>
Stephen <mca### [at] aolcom> wrote:
>
> Use union 2.2.3.2 CSG Union
>
> union{   // Start of union
>
>
>
> }  // End of union
>
> --
>
> Regards
>      Stephen

Thank you, I will give this a try

Ken


Post a reply to this message

From: clipka
Subject: Re: grouping objects for transforms
Date: 5 Feb 2017 18:39:27
Message: <5897715f$1@news.povray.org>
Am 05.02.2017 um 19:27 schrieb Klewlis:

> I want to build the wall laying down on the "concrete slab" then stand it and
> move it into place as one unit.  I am currently building the wall standing up
> which is not very realistic.

Maybe it helps to recall that an animation's frames do not all have to
have the same hierarchical strucuture; for instance, you can use:

    #declare Part1 = box {...}
    #declare Part2 = box {...}

    #if (clock < 0.5)

        // move items individually
        object { Part1 rotate ... translate ... }
        object { Part2 rotate ... translate ... }

    #else

        // move items together
        union {
          object { Part1 }
          object { Part2 }
          rotate ... translate ...
        }

    #end


Post a reply to this message

From: Stephen
Subject: Re: grouping objects for transforms
Date: 5 Feb 2017 18:39:38
Message: <5897716a$1@news.povray.org>
On 2/5/2017 6:27 PM, Klewlis wrote:
>
>
> I want to build the wall laying down on the "concrete slab" then stand it and
> move it into place as one unit.  I am currently building the wall standing up
> which is not very realistic.
>
>
>
I would say that building a wall standing up is the way most people 
build walls. ;-)

-- 

Regards
     Stephen


Post a reply to this message

From: Stephen
Subject: Re: grouping objects for transforms
Date: 5 Feb 2017 18:43:00
Message: <58977234@news.povray.org>
On 2/5/2017 6:29 PM, Klewlis wrote:
> Stephen <mca### [at] aolcom> wrote:
>>
>> Use union 2.2.3.2 CSG Union
>>
>> union{   // Start of union
>>
>>
>>
>> }  // End of union
>>
>> --
>>
>> Regards
>>       Stephen
>
> Thank you, I will give this a try
>

Although it is not recommended. You can use nested unions to have 
various local transformation points.



-- 

Regards
     Stephen


Post a reply to this message

From: Klewlis
Subject: Re: grouping objects for transforms
Date: 5 Feb 2017 19:30:01
Message: <web.58977c586098c6675f9209890@news.povray.org>
Stephen <mca### [at] aolcom> wrote:
> On 2/5/2017 6:27 PM, Klewlis wrote:
> >
> >
> > I want to build the wall laying down on the "concrete slab" then stand it and
> > move it into place as one unit.  I am currently building the wall standing up
> > which is not very realistic.
> >
> >
> >
> I would say that building a wall standing up is the way most people
> build walls. ;-)
>
> --
>
> Regards
>      Stephen

actually, I framed houses for many years.  We always built the wall laying down
on the slab, then stood it up and nailed it in place.


Post a reply to this message

From: Klewlis
Subject: Re: grouping objects for transforms
Date: 5 Feb 2017 19:40:01
Message: <web.58977e9f6098c6675f9209890@news.povray.org>
clearly I don't understand how the clock works with animation yet.  When I
render I get the shed completely built on the first frame and 19 repeats of the
same scene.


Post a reply to this message

Goto Latest 10 Messages Next 10 Messages >>>

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