POV-Ray : Newsgroups : povray.general : Averaging transforms : Re: Averaging transforms Server Time
31 Jul 2024 02:27:45 EDT (-0400)
  Re: Averaging transforms  
From: Tim Attwood
Date: 14 Jan 2008 21:19:02
Message: <478c1816$1@news.povray.org>
> Say I've got two different expressions or algorithms for defining a 
> transform. I
> want to transition from one to the other very gradually as I proceed along 
> a
> series of frames.   Say a "walk" transform" going to a "run" transform.
>
> Can two different transforms be averaged together?  I'm not sure if this 
> would
> be trivial or impossible.
>
Seems straightforward if you save the location of some
object to disk every frame... there's probably a formula
for it too, but it doesn't spring to mind, some sort of
quadratic...

// state of animation
#if (frame_number = 1)
   #declare old_loc = <-0.1,0,0>;
#else
   #fopen File "anim.tmp" read
   #read (File, old_loc)
   #fclose File
#end

#declare walk_speed= 0.1*clock_delta;
#declare run_speed= 1*clock_delta;
#declare speed = (run_speed-walk_speed)*clock+walk_speed;
#declare dir = <1,0,0>;
#declare loc = transform {translate old_loc + speed*dir};

// scene

// save state
#fopen File "anim.tmp" write
#write File concat("<",vstr(3, loc, ", ", 0,5),">")
#fclose File


Post a reply to this message

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