![](/i/fill.gif) |
![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Okay, maybe the is the way to do it: apply the two transforms to the same stick,
then average the sticks, then extract a new transform out of the new stick. I
tried to posit this in SDL but my head started to hurt.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"gregjohn" ha scritto
> Okay, maybe the is the way to do it: apply the two transforms to the same stick,
> then average the sticks, then extract a new transform out of the new stick. I
> tried to posit this in SDL but my head started to hurt.
>
Following there's a sketch to extract the rows of the matrix
from a generic transformation and blend them in an
'average' transform.
HTH Massimo
#declare T1 = transform { rotate 30 * z }
#declare T2 = transform { scale <.75, 1.25, 1> }
#declare F1 = function { transform { T1 } }
#declare F2 = function { transform { T2 } }
#declare Row3 = F2(0 0 0) * clock + F1(0 0 0) * (1 - clock);
#declare Row0 = F2(1 0 0) * clock + F1(1 0 0) * (1 - clock) - Row3;
#declare Row1 = F2(0 1 0) * clock + F1(0 1 0) * (1 - clock) - Row3;
#declare Row2 = F2(0 0 1) * clock + F1(0 0 1) * (1 - clock) - Row3;
#declare T12 = transform { matrix
< Row0.x, Row0.y, Row0.z
, Row1.x, Row1.y, Row1.z
, Row2.x, Row2.y, Row2.z
, Row3.x, Row3.y, Row3.z>}
light_source { 0, rgb 1}
background { rgb 1}
box { -.25, .25 transform {T12} translate z pigment {red 1} }
box { -.25, .25 transform {T1} translate z+.0001 pigment {green .5}}
box { -.25, .25 transform {T2} translate z+.0001 pigment {green .5}}
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Massimo Valentini <not### [at] vailable invalid> wrote:
> Following there's a sketch to extract the rows of the matrix
> from a generic transformation and blend them in an
> 'average' transform.
If I'm not mistaken, if you simply average two transformation matrices,
the transformations in-between will be quite distorted. You won't get nice
rotations and translations.
--
- Warp
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"Warp" ha scritto
> Massimo Valentini <not### [at] vailable invalid> wrote:
> > Following there's a sketch to extract the rows of the matrix
> > from a generic transformation and blend them in an
> > 'average' transform.
>
> If I'm not mistaken, if you simply average two transformation matrices,
> the transformations in-between will be quite distorted. You won't get nice
> rotations and translations.
>
It is an interpolation, if you don't get nice rotations and translations
you may add a third transformation in-between, or a third and a fourth
or ...
Massimo
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"gregjohn" <pte### [at] yahoo com> 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.
There's no reason why this wouldn't be possible. I'd have to see the actual code
to make suggestions, as I haven't personally experimented with human motion
animations and can't refer to memory.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"SharkD" <nomail@nomail> wrote:
> "gregjohn" <pte### [at] yahoo com> 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.
>
> There's no reason why this wouldn't be possible. I'd have to see the actual code
> to make suggestions, as I haven't personally experimented with human motion
> animations and can't refer to memory.
Scratch that. What you want to do is create a single equation for both cases
that takes into account a variable, "speed". As speed increases, the animation
transitions from "walking" to "running".
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
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
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |