POV-Ray : Newsgroups : povray.newusers : Rotation then Translation inside an animation : Re: Rotation then Translation inside an animation Server Time
13 May 2024 16:46:54 EDT (-0400)
  Re: Rotation then Translation inside an animation  
From: Warp
Date: 1 Apr 2014 11:58:33
Message: <533ae228@news.povray.org>
Romain <nomail@nomail> wrote:
> I'm going to use you're method which is easier than mine :)

If you need to "collect" lots of transformations like that, rather than
having to repeat all previous transformations in increasingly-nested
#else blocks, you can literally collect them into one single transform
variable, which you can then apply to your object.

Also, you may want to use the min() function instead of #if blocks,
as it makes it much simpler.

For example like this:

#declare Tr = transform { rotate <0, min(clock, 2.5)*360, 0> };
#declare Tr = transform { Tr translate <min(clock-2.5, 2.5)*5, 0, 0> };
#declare Tr = transform { rotate <0, min(clock-5.0, 2.5)*360, 0> };

...

  object
  {
    YourObject
    transform { Tr }
  }

-- 
                                                          - Warp


Post a reply to this message

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