View Full Version : Some questions about matrices

Ehsan Kamrani

03-10-2010, 09:13 AM

I asked this question here (http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=258169#Post2581 69) but nobody responsed me :(

1)In an open source example, the programmer has used the row major matrices and pre multiplication .finally he has passed the results to the glMultMatrix().

Is it possible?

2)The skinning calculation which is used in animation skinning for each vertex v in a bind shape is

http://i45.tinypic.com/1zcohes.jpg

where:

• n: The number of joints that influence vertex v

• BSM: Bind-shape matrix

• IBMi: Inverse bind-pose matrix of joint i

• JMi: Transformation matrix of joint i

• JW: Weight of the influence of joint i on vertex v

So it seems that this equation should be used with row major matrices because v( vertex )is on the left side?

So can I use column major matrices and reverse the order of multiplications in this formula? (so i can get the formula : sigma( JW * JMi * IBMi * BSM * v ))

dCelsius

03-12-2010, 07:06 AM

1)In an open source example, the programmer has used the row major matrices and pre multiplication .finally he has passed the results to the glMultMatrix().

Is it possible?

I didn't understand. See if this helps:

"void glMultMatrix{fd}(const TYPE *m);

Multiplies the matrix specified by the 16 values (matrix 4x4) pointed to by m by the current matrix and stores the result as the current matrix."

Means it will multiply everything in the matrix by the number passed in the parameter.

dorbie

03-12-2010, 03:47 PM

Hey Ehsan, finally I see your face :-).

Please start your own threads for new topics. Appending to another thread might going to get you ignored. You've inspired me to add an avatar icon.......

dorbie

03-12-2010, 03:50 PM

P.S. dunno the math, but this is transpose and it affects pre vs post multiplication order, it is also tied to whether your vertex is row or column notation. They are equivalent with only notational differences until they hit the OpenGl pipeline at which time they have to match the implementation.

This is why uniforms have a transpose field, because some people take issue with the orientation of OpenGL's default matrix.

beginnertom

03-12-2010, 06:42 PM

no no no it is wrong.

i doubt about your Calculation.

you need mult?

the rigth Calculation should be v1=v1-(v2-v1)/v3.

Ehsan Kamrani

03-13-2010, 03:05 AM

Hi Angus :)

It was really interesting to see you photo too :) ( I don't know if I have used correct English words, but it really made me happy : ) )

Guess what... After 2 months of hard work, I could load many features of Collada files including lights, static models, etc . But the hard part is loading and animating the skeletal based characters.Here are 2 screen shots of my current engine:

http://i43.tinypic.com/14m7wjc.jpg

http://i40.tinypic.com/5z0ewy.jpg

I created those simple spheres and teapots in 3DS Max and used OpenCollada to export the collada files.

However I need to add too many new features to my engine and its interface including bump mapping, parallax mapping,projected shadows, etc.I guess It's enough for me to still make simple games!

beginnertom

03-14-2010, 04:12 AM

hello ehsan.

your engine is so good.

i think i had learn some experices from your post.

Ehsan Kamrani

03-14-2010, 06:02 AM

Thanks beginnertom :)

Actually it's just a ColladaLoader and viewer right now ;) I need to work for months to create a full-blown engine:) Collada format consists of any data required for games including <camera>s and <light>s, so we no longer need to worry about the values of gl* functions. we simply load those values from a .dae file.

Powered by vBulletin® Version 4.2.3 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.