POV-Ray : Newsgroups : povray.general : Matrices... ...matrixes... ...? Server Time
5 Nov 2024 01:25:12 EST (-0500)
  Matrices... ...matrixes... ...? (Message 1 to 4 of 4)  
From: arblick spule
Subject: Matrices... ...matrixes... ...?
Date: 2 Sep 2009 13:05:01
Message: <web.4a9ea4d53684e9d0b75c66c30@news.povray.org>
Hi all,

I'm setting up a kind of "Character Studio" thing in POVRAY and have stumbled
upon math problem that has had me headbutting my screen and slamming my
calculator on my desk for two hours now.  The bruise is BIG!!

Here we go :- Is there any way to convert a Matrix transform into absolute
Translate&Rotate vectors?

I'm using Runes IK leg to deal with all my limbs, however i need to employ
"helper" objects which need to be translated with vrotate etc.  Can't use
matrixes (matrices, matresses?!) with normal rotate commands.

Thanks in advance!


Post a reply to this message

From: triple r
Subject: Re: Matrices... ...matrixes... ...?
Date: 2 Sep 2009 15:45:00
Message: <web.4a9ecafa115a1008958421d50@news.povray.org>
"arblick spule" <aspule> wrote:
> Hi all,
>
> I'm setting up a kind of "Character Studio" thing in POVRAY and have stumbled
> upon math problem that has had me headbutting my screen and slamming my
> calculator on my desk for two hours now.  The bruise is BIG!!
>
> Here we go :- Is there any way to convert a Matrix transform into absolute
> Translate&Rotate vectors?

You can do anything if you put your mind to it.  Sorry I don't have time for a
better answer at the moment, but if you think about rotating in one plane until
you're as close as you can get, then you rotate in the next plane to align the
axes, then you rotate around the axis to complete the alignment.  This all
assumes that it is only a rotation, not a skew-transformation.  (You could
always use the singular value decomposition to put a general transformation in
terms of two rotations and an scale...)  There might be a plug-and-chug method,
but I would recommend just breaking out dot products and arctan's.

 - Ricky


Post a reply to this message

From: Tim Attwood
Subject: Re: Matrices... ...matrixes... ...?
Date: 2 Sep 2009 21:12:48
Message: <4a9f1810$1@news.povray.org>
> Here we go :- Is there any way to convert a Matrix transform into absolute
> Translate&Rotate vectors?

You can extract the translation and scaling always.
The rotation portion could be skew info, so you need
to check if the vectors are perpendicular.
Once you have the angles of the vectors, you can
split that into three rotations...
face the forward vector forward, rotate the others
with it, the first angle, Y
face the forward vector onto the the XZ plane,
the second angle X, bringing the changes along again,
then rotate the right vector to the XZ right, and
that's the third angle Z.
So your final roations are just the inverse of Z,X,Y.


Post a reply to this message

From: arblick spule
Subject: Re: Matrices... ...matrixes... ...?
Date: 3 Sep 2009 11:00:00
Message: <web.4a9fd8c5115a1008b75c66c30@news.povray.org>
Doh!  Turns out my problem was not needing the angles (although later macros
will need to do that (Look_At)).  What I need is the absolute position of the
point that has been rotated.  I.E. Just matrix multiply it!

I was starting with an object to symbolise a limb for an animated matey.  This
is always modelled at <0,0,0> pointing up Y.  The idea was to be able to attach
a helper at, say, <.5,0,0> which would have the limb as it's parent.  This limb
and it's little children would be rotated into place by the IK macro.

Knowing that, we can just Multiply the matrix ourselves and add the translations
and Bob's Yer Uncle.

Then, for instance, you could use that helper to attach a bendable pnumatic hose
between two limbs etc.

Thanks for your replys anyhow, because after reading them I begin to understand
more fully the whole Vector Maths thing.

Cheers!


Post a reply to this message

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