The MASM Forum
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
September 09, 2010, 01:49:02 am
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search:
Advanced search
MASM32 Downloads
Forum Links and Website
Archived Old Forum Files
Links for VC and MASM
117346
Posts in
14003
Topics by
1654
Members
Latest Member:
road_hog
The MASM Forum
Project Support Forums
OpenGL Forum
(Moderator:
hitchhikr
)
glMultMatrixf
« previous
next »
Pages:
[
1
]
Author
Topic: glMultMatrixf (Read 972 times)
Farabi
Accountant
Member
Gender:
Posts: 1474
MASM+OpenGL Fanatic
glMultMatrixf
«
on:
August 19, 2009, 04:45:16 am »
Is glMultMatrixf same with this code?
Code:
matrix16f operator* (const matrix16f &m1, const matrix16f &m2)
{
matrix16f result;
// row 0
result.matrix[0] = (m1.matrix[0]*m2.matrix[0]) + (m1.matrix[4]*m2.matrix[1]) +(m1.matrix[8]*m2.matrix[2]) +(m1.matrix[12]*m2.matrix[3]);
result.matrix[4] = (m1.matrix[0]*m2.matrix[4]) + (m1.matrix[4]*m2.matrix[5]) +(m1.matrix[8]*m2.matrix[6]) +(m1.matrix[12]*m2.matrix[7]);
result.matrix[8] = (m1.matrix[0]*m2.matrix[8]) + (m1.matrix[4]*m2.matrix[9]) +(m1.matrix[8]*m2.matrix[10])+(m1.matrix[12]*m2.matrix[11]);
result.matrix[12]= (m1.matrix[0]*m2.matrix[12])+ (m1.matrix[4]*m2.matrix[13])+(m1.matrix[8]*m2.matrix[14])+(m1.matrix[12]*m2.matrix[15]);
// row 1
result.matrix[1] = (m1.matrix[1]*m2.matrix[0]) +(m1.matrix[5]*m2.matrix[1]) +(m1.matrix[9]*m2.matrix[2]) +(m1.matrix[13]*m2.matrix[3]);
result.matrix[5] = (m1.matrix[1]*m2.matrix[4]) +(m1.matrix[5]*m2.matrix[5]) +(m1.matrix[9]*m2.matrix[6]) +(m1.matrix[13]*m2.matrix[7]);
result.matrix[9] = (m1.matrix[1]*m2.matrix[8]) +(m1.matrix[5]*m2.matrix[9]) +(m1.matrix[9]*m2.matrix[10])+(m1.matrix[13]*m2.matrix[11]);
result.matrix[13]= (m1.matrix[1]*m2.matrix[12])+(m1.matrix[5]*m2.matrix[13])+(m1.matrix[9]*m2.matrix[14])+(m1.matrix[13]*m2.matrix[15]);
// row 2
result.matrix[2] = (m1.matrix[2]*m2.matrix[0]) +(m1.matrix[6]*m2.matrix[1]) +(m1.matrix[10]*m2.matrix[2]) +(m1.matrix[14]*m2.matrix[3]);
result.matrix[6] = (m1.matrix[2]*m2.matrix[4]) +(m1.matrix[6]*m2.matrix[5]) +(m1.matrix[10]*m2.matrix[6]) +(m1.matrix[14]*m2.matrix[7]);
result.matrix[10]= (m1.matrix[2]*m2.matrix[8]) +(m1.matrix[6]*m2.matrix[9]) +(m1.matrix[10]*m2.matrix[10])+(m1.matrix[14]*m2.matrix[11]);
result.matrix[14]= (m1.matrix[2]*m2.matrix[12])+(m1.matrix[6]*m2.matrix[13])+(m1.matrix[10]*m2.matrix[14])+(m1.matrix[14]*m2.matrix[15]);
// row 3
result.matrix[3] = (m1.matrix[3]*m2.matrix[0]) +(m1.matrix[7]*m2.matrix[1]) +(m1.matrix[11]*m2.matrix[2]) +(m1.matrix[15]*m2.matrix[3]);
result.matrix[7] = (m1.matrix[3]*m2.matrix[4]) +(m1.matrix[7]*m2.matrix[5]) +(m1.matrix[11]*m2.matrix[6]) +(m1.matrix[15]*m2.matrix[7]);
result.matrix[11]= (m1.matrix[3]*m2.matrix[8]) +(m1.matrix[7]*m2.matrix[9]) +(m1.matrix[11]*m2.matrix[10])+(m1.matrix[15]*m2.matrix[11]);
result.matrix[15]= (m1.matrix[3]*m2.matrix[12])+(m1.matrix[7]*m2.matrix[13])+(m1.matrix[11]*m2.matrix[14])+(m1.matrix[15]*m2.matrix[15]);
return result;
}
Logged
19:33 And if a man from another country is living in your land with you, do not make life hard for him; (My website is under construction, dont know when it will be done)
Pages:
[
1
]
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Welcome To New Members
-----------------------------
=> How To Successfully Join The MASM Forum
=> Introduction
=> The Rules Of The Forum
=> Changes to the Masm Forum
-----------------------------
General Forums
-----------------------------
=> The Campus
=> The Workshop
=> The Laboratory
=> The Soap Box
=> The Colosseum
-----------------------------
Project Support Forums
-----------------------------
=> MASM32
===> WINDOWS.INC Project
===> Starting with MASM32
===> MASM32 Licencing
===> AV Software sh*t list.
=> GoAsm Assembler and Tools
=> HLA Forum
=> PowerBASIC Low Level Code
===> Archival PowerBASIC Code
=> The GeneSys Development System
===> API tutorial set
===> User Contributed Code
=> IDE Development and Support
===> RadAsm Support Forum
===> WinAsm Studio
===> ASMedit
===> Easy Code
=====> Easy Code Tutorials
=> OpenGL Forum
=> 64 Bit Assembler
-----------------------------
Specialised Projects
-----------------------------
=> Assembler/Compiler Technology
=> Pelle's Macro Assembler Development
=> High Performance Ray Tracing
=> Custom Interface Components
=> Compiler Based Assembler
===> Assembler With Microsoft Visual C
===> Pelle's C compiler and tools
-----------------------------
Miscellaneous Forums
-----------------------------
=> Miscellaneous Projects
===> Windows Projects
=> The Orphanage
=> 16 bit DOS Programming
-----------------------------
Toddler's Corner
-----------------------------
=> Romper Room