[Fluxus] matrix blending

Dave Griffiths dave at pawfal.org
Thu Dec 11 12:20:39 PST 2008


> hi
>
> i'm trying to implement a camera that flies around on a sort of arm
> made of two locators - one is the origin of the arm and center of
> rotation, the other holds the camera and can be extended. I had to
> change the camera attachment logic, so that camera follows the object
> in world coordinates:
>
> http://git.savannah.gnu.org/gitweb/?p=fluxus.git;a=commitdiff;h=02898c88b024aa4c3624c4d5fe82f86b47fe98f5
>
> (that's my qt branch, but I guess this patch would apply to master as
> well).

Thanks for that... Looks like (due to Linus I guess) patches are well
supported in git - can we merge across branches more officially? Does it
help that the qt stuff will just be in fluxus/src?

> I use the attached script to test this constriuction (joystick
> controlled) and I noticed, that matrix blending used with camera-lag
> now causes some unpleasant squashing. without camera-lag the box looks
> OK. is there anything I could do to fix the blended matrix?

I've grown quite fond of the squashing, but it's happening because it's
doing the blend completely wrong. The proper way to do it is to decompose
the matrix into transform, scale and rotation - lerp the transform and
scale, and do the rotation as a quaternion slerp.

At the moment the scale and rotation are mixed up in the matrix - you
shouldn't really treat matrices like this - the exception is skinning,
where you create a weighted average of multiple matrices - but the
rotation isn't important, as it's mainly vertex translations.

cheers,

dave




More information about the Fluxus mailing list