Matrix Issues

Posted:
Mon Jul 14, 2008 4:56 am
by Lontahv
Didn't know where else to put this (scripting journal looks a little locked up

).
I've gotten some simple cluster-group mesh exporting correctly, now I have to deal with the Blender->plSpanInstance part.
Now, this wouldn't be such a problem if Cyan hadn't made L2W the only 4x3 in Plasma. And it doesn't help that Blender only outputs 4x4's.
I was reading about 3d matrices online and it seems like 3x3's can hold rotation info, 4x4's hold rotation and translation info... UH why is Cyan using a odd in-between for Local2World?

Why not just do what they did for spans and use 4x4's.
/me is starting to realize why Drizzle has no Cluster-Group support (and Drizzle doesn't even have to make anything new *HRMPH*).
Well, hopefully someone with more matrix-math knowledge will arrive on the scene and save me from this.

Re: Matrix Issues

Posted:
Mon Jul 14, 2008 5:15 am
by Christian Walther
Not sure if this helps, since most of what you're saying is Greek to me:
When you have only rotation and translation (or a general affine transform) in a 4x4 matrix, its last row is always [0 0 0 1]. So a 4x3 (or is that 3x4?) matrix is actually sufficient to store an affine transform. Putting anything different into the fourth row gets you a projective transform.
Re: Matrix Issues

Posted:
Mon Jul 14, 2008 6:44 am
by Aloys
OMG call neo!
(what? someone had to do it, right?.. okay; thinking of it, maybe not.

)
Re: Matrix Issues

Posted:
Mon Jul 14, 2008 7:22 am
by Lontahv
Well, just to make sure you people have the idea (and I'm not just confusing you if I'm in the wrong with the matrix's name):
Here's the layout (even if it's not the matrix-Null):
[[0,0,0,0], [0,0,0,0], [0,0,0,0]]
or in usual matrix style:
[[0,0,0,0],
[0,0,0,0],
[0,0,0,0]]
Maybe this is just a lobbed-off 4x4.
I guess I can try to figure out from the Cyan ones... but that'd be the last resort. I'd like to figure this out fully rather than probing around (if I can).
Re: Matrix Issues

Posted:
Mon Jul 14, 2008 11:11 am
by Grogyan
Like you i'm going to have to study this script hard
http://blenderfrance.free.fr/python/Trajectory_en.htmThe guy that did it uses matrices.
Its almost what i'm trying to achieve, but right now it'll probably help you more
Re: Matrix Issues

Posted:
Mon Jul 14, 2008 11:41 am
by PhilippH
I haven't done much in 3D manipulation myself. So this is just a guess.
Perhaps the 3x3 part of the matrix is the normal rotation and in the remaining 3x1 part is the translation? Like [x, y, z] means move x in x direction, y, z accordingly.
Re: Matrix Issues

Posted:
Mon Jul 14, 2008 11:45 am
by Nadnerb
I'm not sure what your problem is. You just need to drop the last row, since it's not useful anyway, as somone pointed out already. Make a new 4x3 and assign the first 3 rows of your 4x4 to it. Just remember you need to transpose your blender matrices before using them in plasma.
Re: Matrix Issues

Posted:
Mon Jul 14, 2008 5:31 pm
by Lontahv
Thanks Nad, I think that helped. I forgot to transpose it and so, it cut off the transform values when I cropped the end off. Problem seems to be solved.
