POV-Ray : Newsgroups : povray.general : Averaging transforms : Re: Averaging transforms Server Time
31 Jul 2024 08:32:17 EDT (-0400)
  Re: Averaging transforms  
From: John VanSickle
Date: 17 Jan 2008 18:07:23
Message: <478fdfab$1@news.povray.org>
gregjohn wrote:
> 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.

Generally, the best way to average two transforms is to extract the 
scale, rotation, and translation transforms from each, interpolate the 
results, and then recombine the interpolated values.

(This all assumes that there is no shearing element in the transforms.)

The scale transform you can either scale in a linear fashion:
	s(x) = a+(b-a)*x
or an exponential fashion
	s(x)=a* exp( ln(b/a)*x )

Try each to see which gives you the results you want.

The transform is easily interpolated:
	t(x) = a+(b-a)*x

The rotation will probably be rather complex, and you may want to break 
down the translation into the three axes first, interpolate between the 
axes, and then recombine them.

Regards,
John


Post a reply to this message

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