The MASM Forum Archive 2004 to 2012

Project Support Forums => OpenGL Forum => Topic started by: Farabi on August 07, 2009, 05:40:53 AM

Title: On which cell it stored?
Post by: Farabi on August 07, 2009, 05:40:53 AM
If I use this code


invoke glpushmatrix
invoke glloadidentity
invoke glrotatef,30,0,1,0
invoke gltranslatef,0,0,0
invoke glGetFloatv,Matrix_arr
invoke glpopmatrix


On which cell on the Matrix_arr the position is stored?
Title: Re: On which cell it stored?
Post by: Damos on August 07, 2009, 07:07:36 AM
That would be the sum of each column:
x = M11 + M21 + M31 + M41
y = M12 + M22 + M32 + M42
z = M13 + M23 + M33 + M43

If I understand your question correctly.
Title: Re: On which cell it stored?
Post by: Farabi on August 07, 2009, 07:51:54 AM
Quote from: Damos on August 07, 2009, 07:07:36 AM
That would be the sum of each column:
x = M11 + M21 + M31 + M41
y = M12 + M22 + M32 + M42
z = M13 + M23 + M33 + M43

If I understand your question correctly.


How is the matrix stored?
m11 m12 m13 m14
m21 m22 m23 m24
m31 m32 m33 m34
..   

or

m11 m21 m31 ..
m12 m22 m32 .
m13 m23 m33 ..
m14 m24 m34 ..
Title: Re: On which cell it stored?
Post by: dancho on August 07, 2009, 03:11:36 PM
In OpenGL matrices are column-major 4x4,like this:

m0 m4 m8   m12
m1 m5 m9   m13
m2 m6 m10 m14
m3 m7 m11 m15

@Farabi
if you can buy this book
http://www.opengl.org/documentation/red_book/
it was helpful to me when I was interested in opengl,
and all examples are in C so it is easly ported to masm...
Title: Re: On which cell it stored?
Post by: Farabi on August 07, 2009, 03:18:48 PM
Quote from: dancho on August 07, 2009, 03:11:36 PM
In OpenGL matrices are column-major 4x4,like this:

m0 m4 m8   m12
m1 m5 m9   m13
m2 m6 m10 m14
m3 m7 m11 m15

@Farabi
if you can buy this book
http://www.opengl.org/documentation/red_book/
it help me greatly when I was interested in opengl,
and all examples are in C so it is easly ported to masm...
Too expensive for me.
Does the matrices is mean like this?

m11 m21 m31 ..
m12 m22 m32 .
m13 m23 m33 ..
m14 m24 m34 ..

?
Title: Re: On which cell it stored?
Post by: dancho on August 07, 2009, 03:29:31 PM
Yes,
there is a link for the free copy of the Redbook ( opengl 1.1 ) html format
at the page I posted...
Title: Re: On which cell it stored?
Post by: Farabi on August 07, 2009, 03:33:21 PM
Im stuck, I dont understand how to calculate the matrices, I uploaded my source.
Take a look at the Mocap.inc on fBVHCalculatePosition function. The fBVHCalculatePosition purpose is to calculate the real position of each node.
Any help would be appreaciated

[attachment deleted by admin]
Title: Re: On which cell it stored?
Post by: bruce1948 on August 07, 2009, 03:59:26 PM
There is a PDF copy of the redbook at http://www.4shared.com/file/7630450/5c8c4fd/redbook.html