matrix transformations and OpenGL

Compiling, libraries, modules, coding guidelines and porting

Moderators: jesterKing, stiv

Tcll
Posts: 63
Joined: Tue Aug 31, 2010 12:11 am
Location: The Forest of Darkness

matrix transformations and OpenGL

Postby Tcll » Sat Jan 14, 2012 1:30 pm

ok...
there isn't really anything in here that deals with blender,
and I apologize if this thread strikes a bad pose.
(but I sincerely hope it doesn't ) >_>

anyways...
I've been going for a few years now and have gotten no answer to my Q.
if someone here could be kind enough to answer this for me,
or at least point me to a good source (since google ain't worth crap),
it would be much appreciated. :)

what I need to know is how to calculate transforms from a 4x3 inverse matrix.

if you're confused as to why:
I'm trying to read from a file that ONLY uses 4x3 inverse bind matrices for it's bones.

I've already tried adding [0,0,0,1] to the end before inverting it, and that doesn't work...
(the model still looks like it went through a blender) lol

anyone mind lending me a hand and informing me on some stuff here?? :)
thanx in return ;)
Image

stiv
Posts: 3646
Joined: Tue Aug 05, 2003 7:58 am
Location: 45N 86W

Postby stiv » Sat Jan 14, 2012 6:03 pm

I need more coffee to even begin to think about matrix math, but...

A good source of math how-to info is the Khan Academy videos.

A 4x3 matrix sounds...curious. I wonder what is in it? Typically transforms and such are 4x4 homogenous coordinates.

Tcll
Posts: 63
Joined: Tue Aug 31, 2010 12:11 am
Location: The Forest of Darkness

Postby Tcll » Sat Jan 14, 2012 7:57 pm

ROFL IK what you mean XDD

a 4x3 matrix (so I've read by many forums) is mainly a transform matrix used by bones...
the arrangement is as usual:
(I go by the width by height format, but I've also seen the row by column (3x4) format)
I'm not sure which is right honestly... >_>

X1 Y1 Z1 O1
X2 Y2 Z2 O2
X3 Y3 Z3 O3

transformation:
X = (VX*X1)+(VX*Y1)+(VX*Z1)+O1
Y = (VY*X2)+(VY*Y2)+(VY*Z2)+O2
Z = (VZ*X3)+(VZ*Y3)+(VZ*Z3)+O3

I'm sure you rmbr me talking about vertex transforms :P
(you actually had to take each vert and calculate it's transform through it's weights to get it's correct position)
^screw you Nintendo >:O

anyways...
my delema is the matrix is the inverse matrix...

unless you know anywhere I can find out how to calculate the inverse pos-
I think I've just answered my own Q... XDD

transform the verts using the inverse matrix,
then add the inverse of the inverse to the vert...

I'll come back if that doesn't work :)

thanx for the references btw. ^_^
Image

Tcll
Posts: 63
Joined: Tue Aug 31, 2010 12:11 am
Location: The Forest of Darkness

Postby Tcll » Sat Jan 14, 2012 8:16 pm

oh wow...
ok... umm...

that didn't go as planned >_>
my model looks horrid D:

anyways...
so I deleted the inversion function that converted a 4x4 matrix,
and inverted the transform value...

I was better before doing this...

hmm...
would model scale have anything to do with it??
(don't answer that right now)
^I still need to calculate the 4th row for the inverse function
(since M+[0,0,0,1] only works half the time)

Tcll
Posts: 63
Joined: Tue Aug 31, 2010 12:11 am
Location: The Forest of Darkness

Postby Tcll » Sun Jan 15, 2012 12:57 am

thank you for those Kahn references :D

what I actually have are 3x4 matrices.
Image

Tcll
Posts: 63
Joined: Tue Aug 31, 2010 12:11 am
Location: The Forest of Darkness

Postby Tcll » Sun Jan 15, 2012 1:34 am

*sigh*
wish I could edit my last post...

anyways...
I've finally gotton some of the educational results I needed on google...
but they weren't any different than what I've already tried >_>

if you'd like to see/test my problem,
I UL'd my latest version of UMC (2.6d) up to my google code...

just search 'Universal Model Converter dev version' on google
(I'd have to write down the link) >_<

you must have Melee (SSBM) with a few Pl****.dat files ripped from it.
just do an OBJ conversion of that file.

you should see the problem I'm having...

Pichu is my best conversion that I've tested.

any help would be appreciated, and thanx in return ;)

Tcll
Posts: 63
Joined: Tue Aug 31, 2010 12:11 am
Location: The Forest of Darkness

Postby Tcll » Tue Jan 17, 2012 1:08 pm

bump

so how goes everything?? :/

I havn't accomplished anything or gotten anywhere -.-*


Return to “Coding Blender”

Who is online

Users browsing this forum: No registered users and 2 guests