Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
8fc8f262
Commit
8fc8f262
authored
Nov 09, 2007
by
Francois Gouget
Committed by
Alexandre Julliard
Nov 09, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx8: Fix compilation on systems that don't support nameless unions.
parent
124f2aa2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
276 additions
and
273 deletions
+276
-273
math.c
dlls/d3dx8/math.c
+161
-158
math.c
dlls/d3dx8/tests/math.c
+115
-115
No files found.
dlls/d3dx8/math.c
View file @
8fc8f262
...
...
@@ -20,6 +20,9 @@
#include <stdlib.h>
#include <stdarg.h>
#include <assert.h>
#define NONAMELESSUNION
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
...
...
@@ -36,11 +39,11 @@ FLOAT WINAPI D3DXMatrixfDeterminant(CONST D3DXMATRIX *pm)
D3DXVECTOR4
minor
,
v1
,
v2
,
v3
;
FLOAT
det
;
v1
.
x
=
pm
->
m
[
0
][
0
];
v1
.
y
=
pm
->
m
[
1
][
0
];
v1
.
z
=
pm
->
m
[
2
][
0
];
v1
.
w
=
pm
->
m
[
3
][
0
];
v2
.
x
=
pm
->
m
[
0
][
1
];
v2
.
y
=
pm
->
m
[
1
][
1
];
v2
.
z
=
pm
->
m
[
2
][
1
];
v2
.
w
=
pm
->
m
[
3
][
1
];
v3
.
x
=
pm
->
m
[
0
][
2
];
v3
.
y
=
pm
->
m
[
1
][
2
];
v3
.
z
=
pm
->
m
[
2
][
2
];
v3
.
w
=
pm
->
m
[
3
][
2
];
v1
.
x
=
pm
->
u
.
m
[
0
][
0
];
v1
.
y
=
pm
->
u
.
m
[
1
][
0
];
v1
.
z
=
pm
->
u
.
m
[
2
][
0
];
v1
.
w
=
pm
->
u
.
m
[
3
][
0
];
v2
.
x
=
pm
->
u
.
m
[
0
][
1
];
v2
.
y
=
pm
->
u
.
m
[
1
][
1
];
v2
.
z
=
pm
->
u
.
m
[
2
][
1
];
v2
.
w
=
pm
->
u
.
m
[
3
][
1
];
v3
.
x
=
pm
->
u
.
m
[
0
][
2
];
v3
.
y
=
pm
->
u
.
m
[
1
][
2
];
v3
.
z
=
pm
->
u
.
m
[
2
][
2
];
v3
.
w
=
pm
->
u
.
m
[
3
][
2
];
D3DXVec4Cross
(
&
minor
,
&
v1
,
&
v2
,
&
v3
);
det
=
-
(
pm
->
m
[
0
][
3
]
*
minor
.
x
+
pm
->
m
[
1
][
3
]
*
minor
.
y
+
pm
->
m
[
2
][
3
]
*
minor
.
z
+
pm
->
m
[
3
][
3
]
*
minor
.
w
);
det
=
-
(
pm
->
u
.
m
[
0
][
3
]
*
minor
.
x
+
pm
->
u
.
m
[
1
][
3
]
*
minor
.
y
+
pm
->
u
.
m
[
2
][
3
]
*
minor
.
z
+
pm
->
u
.
m
[
3
][
3
]
*
minor
.
w
);
return
det
;
}
...
...
@@ -54,22 +57,22 @@ D3DXMATRIX* WINAPI D3DXMatrixLookAtLH(D3DXMATRIX *pout, CONST D3DXVECTOR3 *peye,
D3DXVec3Cross
(
&
up
,
&
vec
,
&
right
);
D3DXVec3Normalize
(
&
rightn
,
&
right
);
D3DXVec3Normalize
(
&
upn
,
&
up
);
pout
->
m
[
0
][
0
]
=
rightn
.
x
;
pout
->
m
[
1
][
0
]
=
rightn
.
y
;
pout
->
m
[
2
][
0
]
=
rightn
.
z
;
pout
->
m
[
3
][
0
]
=
-
D3DXVec3Dot
(
&
rightn
,
peye
);
pout
->
m
[
0
][
1
]
=
upn
.
x
;
pout
->
m
[
1
][
1
]
=
upn
.
y
;
pout
->
m
[
2
][
1
]
=
upn
.
z
;
pout
->
m
[
3
][
1
]
=
-
D3DXVec3Dot
(
&
upn
,
peye
);
pout
->
m
[
0
][
2
]
=
vec
.
x
;
pout
->
m
[
1
][
2
]
=
vec
.
y
;
pout
->
m
[
2
][
2
]
=
vec
.
z
;
pout
->
m
[
3
][
2
]
=
-
D3DXVec3Dot
(
&
vec
,
peye
);
pout
->
m
[
0
][
3
]
=
0
.
0
f
;
pout
->
m
[
1
][
3
]
=
0
.
0
f
;
pout
->
m
[
2
][
3
]
=
0
.
0
f
;
pout
->
m
[
3
][
3
]
=
1
.
0
f
;
pout
->
u
.
m
[
0
][
0
]
=
rightn
.
x
;
pout
->
u
.
m
[
1
][
0
]
=
rightn
.
y
;
pout
->
u
.
m
[
2
][
0
]
=
rightn
.
z
;
pout
->
u
.
m
[
3
][
0
]
=
-
D3DXVec3Dot
(
&
rightn
,
peye
);
pout
->
u
.
m
[
0
][
1
]
=
upn
.
x
;
pout
->
u
.
m
[
1
][
1
]
=
upn
.
y
;
pout
->
u
.
m
[
2
][
1
]
=
upn
.
z
;
pout
->
u
.
m
[
3
][
1
]
=
-
D3DXVec3Dot
(
&
upn
,
peye
);
pout
->
u
.
m
[
0
][
2
]
=
vec
.
x
;
pout
->
u
.
m
[
1
][
2
]
=
vec
.
y
;
pout
->
u
.
m
[
2
][
2
]
=
vec
.
z
;
pout
->
u
.
m
[
3
][
2
]
=
-
D3DXVec3Dot
(
&
vec
,
peye
);
pout
->
u
.
m
[
0
][
3
]
=
0
.
0
f
;
pout
->
u
.
m
[
1
][
3
]
=
0
.
0
f
;
pout
->
u
.
m
[
2
][
3
]
=
0
.
0
f
;
pout
->
u
.
m
[
3
][
3
]
=
1
.
0
f
;
return
pout
;
}
...
...
@@ -83,22 +86,22 @@ D3DXMATRIX* WINAPI D3DXMatrixLookAtRH(D3DXMATRIX *pout, CONST D3DXVECTOR3 *peye,
D3DXVec3Cross
(
&
up
,
&
vec
,
&
right
);
D3DXVec3Normalize
(
&
rightn
,
&
right
);
D3DXVec3Normalize
(
&
upn
,
&
up
);
pout
->
m
[
0
][
0
]
=
-
rightn
.
x
;
pout
->
m
[
1
][
0
]
=
-
rightn
.
y
;
pout
->
m
[
2
][
0
]
=
-
rightn
.
z
;
pout
->
m
[
3
][
0
]
=
D3DXVec3Dot
(
&
rightn
,
peye
);
pout
->
m
[
0
][
1
]
=
upn
.
x
;
pout
->
m
[
1
][
1
]
=
upn
.
y
;
pout
->
m
[
2
][
1
]
=
upn
.
z
;
pout
->
m
[
3
][
1
]
=
-
D3DXVec3Dot
(
&
upn
,
peye
);
pout
->
m
[
0
][
2
]
=
-
vec
.
x
;
pout
->
m
[
1
][
2
]
=
-
vec
.
y
;
pout
->
m
[
2
][
2
]
=
-
vec
.
z
;
pout
->
m
[
3
][
2
]
=
D3DXVec3Dot
(
&
vec
,
peye
);
pout
->
m
[
0
][
3
]
=
0
.
0
f
;
pout
->
m
[
1
][
3
]
=
0
.
0
f
;
pout
->
m
[
2
][
3
]
=
0
.
0
f
;
pout
->
m
[
3
][
3
]
=
1
.
0
f
;
pout
->
u
.
m
[
0
][
0
]
=
-
rightn
.
x
;
pout
->
u
.
m
[
1
][
0
]
=
-
rightn
.
y
;
pout
->
u
.
m
[
2
][
0
]
=
-
rightn
.
z
;
pout
->
u
.
m
[
3
][
0
]
=
D3DXVec3Dot
(
&
rightn
,
peye
);
pout
->
u
.
m
[
0
][
1
]
=
upn
.
x
;
pout
->
u
.
m
[
1
][
1
]
=
upn
.
y
;
pout
->
u
.
m
[
2
][
1
]
=
upn
.
z
;
pout
->
u
.
m
[
3
][
1
]
=
-
D3DXVec3Dot
(
&
upn
,
peye
);
pout
->
u
.
m
[
0
][
2
]
=
-
vec
.
x
;
pout
->
u
.
m
[
1
][
2
]
=
-
vec
.
y
;
pout
->
u
.
m
[
2
][
2
]
=
-
vec
.
z
;
pout
->
u
.
m
[
3
][
2
]
=
D3DXVec3Dot
(
&
vec
,
peye
);
pout
->
u
.
m
[
0
][
3
]
=
0
.
0
f
;
pout
->
u
.
m
[
1
][
3
]
=
0
.
0
f
;
pout
->
u
.
m
[
2
][
3
]
=
0
.
0
f
;
pout
->
u
.
m
[
3
][
3
]
=
1
.
0
f
;
return
pout
;
}
...
...
@@ -110,7 +113,7 @@ D3DXMATRIX* WINAPI D3DXMatrixMultiply(D3DXMATRIX *pout, CONST D3DXMATRIX *pm1, C
{
for
(
j
=
0
;
j
<
4
;
j
++
)
{
pout
->
m
[
i
][
j
]
=
pm1
->
m
[
i
][
0
]
*
pm2
->
m
[
0
][
j
]
+
pm1
->
m
[
i
][
1
]
*
pm2
->
m
[
1
][
j
]
+
pm1
->
m
[
i
][
2
]
*
pm2
->
m
[
2
][
j
]
+
pm1
->
m
[
i
][
3
]
*
pm2
->
m
[
3
][
j
];
pout
->
u
.
m
[
i
][
j
]
=
pm1
->
u
.
m
[
i
][
0
]
*
pm2
->
u
.
m
[
0
][
j
]
+
pm1
->
u
.
m
[
i
][
1
]
*
pm2
->
u
.
m
[
1
][
j
]
+
pm1
->
u
.
m
[
i
][
2
]
*
pm2
->
u
.
m
[
2
][
j
]
+
pm1
->
u
.
m
[
i
][
3
]
*
pm2
->
u
.
m
[
3
][
j
];
}
}
return
pout
;
...
...
@@ -119,120 +122,120 @@ D3DXMATRIX* WINAPI D3DXMatrixMultiply(D3DXMATRIX *pout, CONST D3DXMATRIX *pm1, C
D3DXMATRIX
*
WINAPI
D3DXMatrixOrthoLH
(
D3DXMATRIX
*
pout
,
FLOAT
w
,
FLOAT
h
,
FLOAT
zn
,
FLOAT
zf
)
{
D3DXMatrixIdentity
(
pout
);
pout
->
m
[
0
][
0
]
=
2
.
0
f
/
w
;
pout
->
m
[
1
][
1
]
=
2
.
0
f
/
h
;
pout
->
m
[
2
][
2
]
=
1
.
0
f
/
(
zf
-
zn
);
pout
->
m
[
3
][
2
]
=
zn
/
(
zn
-
zf
);
pout
->
u
.
m
[
0
][
0
]
=
2
.
0
f
/
w
;
pout
->
u
.
m
[
1
][
1
]
=
2
.
0
f
/
h
;
pout
->
u
.
m
[
2
][
2
]
=
1
.
0
f
/
(
zf
-
zn
);
pout
->
u
.
m
[
3
][
2
]
=
zn
/
(
zn
-
zf
);
return
pout
;
}
D3DXMATRIX
*
WINAPI
D3DXMatrixOrthoOffCenterLH
(
D3DXMATRIX
*
pout
,
FLOAT
l
,
FLOAT
r
,
FLOAT
b
,
FLOAT
t
,
FLOAT
zn
,
FLOAT
zf
)
{
D3DXMatrixIdentity
(
pout
);
pout
->
m
[
0
][
0
]
=
2
.
0
f
/
(
r
-
l
);
pout
->
m
[
1
][
1
]
=
2
.
0
f
/
(
t
-
b
);
pout
->
m
[
2
][
2
]
=
1
.
0
f
/
(
zf
-
zn
);
pout
->
m
[
3
][
0
]
=
-
1
.
0
f
-
2
.
0
f
*
l
/
(
r
-
l
);
pout
->
m
[
3
][
1
]
=
1
.
0
f
+
2
.
0
f
*
t
/
(
b
-
t
);
pout
->
m
[
3
][
2
]
=
zn
/
(
zn
-
zf
);
pout
->
u
.
m
[
0
][
0
]
=
2
.
0
f
/
(
r
-
l
);
pout
->
u
.
m
[
1
][
1
]
=
2
.
0
f
/
(
t
-
b
);
pout
->
u
.
m
[
2
][
2
]
=
1
.
0
f
/
(
zf
-
zn
);
pout
->
u
.
m
[
3
][
0
]
=
-
1
.
0
f
-
2
.
0
f
*
l
/
(
r
-
l
);
pout
->
u
.
m
[
3
][
1
]
=
1
.
0
f
+
2
.
0
f
*
t
/
(
b
-
t
);
pout
->
u
.
m
[
3
][
2
]
=
zn
/
(
zn
-
zf
);
return
pout
;
}
D3DXMATRIX
*
WINAPI
D3DXMatrixOrthoOffCenterRH
(
D3DXMATRIX
*
pout
,
FLOAT
l
,
FLOAT
r
,
FLOAT
b
,
FLOAT
t
,
FLOAT
zn
,
FLOAT
zf
)
{
D3DXMatrixIdentity
(
pout
);
pout
->
m
[
0
][
0
]
=
2
.
0
f
/
(
r
-
l
);
pout
->
m
[
1
][
1
]
=
2
.
0
f
/
(
t
-
b
);
pout
->
m
[
2
][
2
]
=
1
.
0
f
/
(
zn
-
zf
);
pout
->
m
[
3
][
0
]
=
-
1
.
0
f
-
2
.
0
f
*
l
/
(
r
-
l
);
pout
->
m
[
3
][
1
]
=
1
.
0
f
+
2
.
0
f
*
t
/
(
b
-
t
);
pout
->
m
[
3
][
2
]
=
zn
/
(
zn
-
zf
);
pout
->
u
.
m
[
0
][
0
]
=
2
.
0
f
/
(
r
-
l
);
pout
->
u
.
m
[
1
][
1
]
=
2
.
0
f
/
(
t
-
b
);
pout
->
u
.
m
[
2
][
2
]
=
1
.
0
f
/
(
zn
-
zf
);
pout
->
u
.
m
[
3
][
0
]
=
-
1
.
0
f
-
2
.
0
f
*
l
/
(
r
-
l
);
pout
->
u
.
m
[
3
][
1
]
=
1
.
0
f
+
2
.
0
f
*
t
/
(
b
-
t
);
pout
->
u
.
m
[
3
][
2
]
=
zn
/
(
zn
-
zf
);
return
pout
;
}
D3DXMATRIX
*
WINAPI
D3DXMatrixOrthoRH
(
D3DXMATRIX
*
pout
,
FLOAT
w
,
FLOAT
h
,
FLOAT
zn
,
FLOAT
zf
)
{
D3DXMatrixIdentity
(
pout
);
pout
->
m
[
0
][
0
]
=
2
.
0
f
/
w
;
pout
->
m
[
1
][
1
]
=
2
.
0
f
/
h
;
pout
->
m
[
2
][
2
]
=
1
.
0
f
/
(
zn
-
zf
);
pout
->
m
[
3
][
2
]
=
zn
/
(
zn
-
zf
);
pout
->
u
.
m
[
0
][
0
]
=
2
.
0
f
/
w
;
pout
->
u
.
m
[
1
][
1
]
=
2
.
0
f
/
h
;
pout
->
u
.
m
[
2
][
2
]
=
1
.
0
f
/
(
zn
-
zf
);
pout
->
u
.
m
[
3
][
2
]
=
zn
/
(
zn
-
zf
);
return
pout
;
}
D3DXMATRIX
*
WINAPI
D3DXMatrixPerspectiveFovLH
(
D3DXMATRIX
*
pout
,
FLOAT
fovy
,
FLOAT
aspect
,
FLOAT
zn
,
FLOAT
zf
)
{
D3DXMatrixIdentity
(
pout
);
pout
->
m
[
0
][
0
]
=
1
.
0
f
/
(
aspect
*
tan
(
fovy
/
2
.
0
f
));
pout
->
m
[
1
][
1
]
=
1
.
0
f
/
tan
(
fovy
/
2
.
0
f
);
pout
->
m
[
2
][
2
]
=
zf
/
(
zf
-
zn
);
pout
->
m
[
2
][
3
]
=
1
.
0
f
;
pout
->
m
[
3
][
2
]
=
(
zf
*
zn
)
/
(
zn
-
zf
);
pout
->
m
[
3
][
3
]
=
0
.
0
f
;
pout
->
u
.
m
[
0
][
0
]
=
1
.
0
f
/
(
aspect
*
tan
(
fovy
/
2
.
0
f
));
pout
->
u
.
m
[
1
][
1
]
=
1
.
0
f
/
tan
(
fovy
/
2
.
0
f
);
pout
->
u
.
m
[
2
][
2
]
=
zf
/
(
zf
-
zn
);
pout
->
u
.
m
[
2
][
3
]
=
1
.
0
f
;
pout
->
u
.
m
[
3
][
2
]
=
(
zf
*
zn
)
/
(
zn
-
zf
);
pout
->
u
.
m
[
3
][
3
]
=
0
.
0
f
;
return
pout
;
}
D3DXMATRIX
*
WINAPI
D3DXMatrixPerspectiveFovRH
(
D3DXMATRIX
*
pout
,
FLOAT
fovy
,
FLOAT
aspect
,
FLOAT
zn
,
FLOAT
zf
)
{
D3DXMatrixIdentity
(
pout
);
pout
->
m
[
0
][
0
]
=
1
.
0
f
/
(
aspect
*
tan
(
fovy
/
2
.
0
f
));
pout
->
m
[
1
][
1
]
=
1
.
0
f
/
tan
(
fovy
/
2
.
0
f
);
pout
->
m
[
2
][
2
]
=
zf
/
(
zn
-
zf
);
pout
->
m
[
2
][
3
]
=
-
1
.
0
f
;
pout
->
m
[
3
][
2
]
=
(
zf
*
zn
)
/
(
zn
-
zf
);
pout
->
m
[
3
][
3
]
=
0
.
0
f
;
pout
->
u
.
m
[
0
][
0
]
=
1
.
0
f
/
(
aspect
*
tan
(
fovy
/
2
.
0
f
));
pout
->
u
.
m
[
1
][
1
]
=
1
.
0
f
/
tan
(
fovy
/
2
.
0
f
);
pout
->
u
.
m
[
2
][
2
]
=
zf
/
(
zn
-
zf
);
pout
->
u
.
m
[
2
][
3
]
=
-
1
.
0
f
;
pout
->
u
.
m
[
3
][
2
]
=
(
zf
*
zn
)
/
(
zn
-
zf
);
pout
->
u
.
m
[
3
][
3
]
=
0
.
0
f
;
return
pout
;
}
D3DXMATRIX
*
WINAPI
D3DXMatrixPerspectiveLH
(
D3DXMATRIX
*
pout
,
FLOAT
w
,
FLOAT
h
,
FLOAT
zn
,
FLOAT
zf
)
{
D3DXMatrixIdentity
(
pout
);
pout
->
m
[
0
][
0
]
=
2
.
0
f
*
zn
/
w
;
pout
->
m
[
1
][
1
]
=
2
.
0
f
*
zn
/
h
;
pout
->
m
[
2
][
2
]
=
zf
/
(
zf
-
zn
);
pout
->
m
[
3
][
2
]
=
(
zn
*
zf
)
/
(
zn
-
zf
);
pout
->
m
[
2
][
3
]
=
1
.
0
f
;
pout
->
m
[
3
][
3
]
=
0
.
0
f
;
pout
->
u
.
m
[
0
][
0
]
=
2
.
0
f
*
zn
/
w
;
pout
->
u
.
m
[
1
][
1
]
=
2
.
0
f
*
zn
/
h
;
pout
->
u
.
m
[
2
][
2
]
=
zf
/
(
zf
-
zn
);
pout
->
u
.
m
[
3
][
2
]
=
(
zn
*
zf
)
/
(
zn
-
zf
);
pout
->
u
.
m
[
2
][
3
]
=
1
.
0
f
;
pout
->
u
.
m
[
3
][
3
]
=
0
.
0
f
;
return
pout
;
}
D3DXMATRIX
*
WINAPI
D3DXMatrixPerspectiveOffCenterLH
(
D3DXMATRIX
*
pout
,
FLOAT
l
,
FLOAT
r
,
FLOAT
b
,
FLOAT
t
,
FLOAT
zn
,
FLOAT
zf
)
{
D3DXMatrixIdentity
(
pout
);
pout
->
m
[
0
][
0
]
=
2
.
0
f
*
zn
/
(
r
-
l
);
pout
->
m
[
1
][
1
]
=
-
2
.
0
f
*
zn
/
(
b
-
t
);
pout
->
m
[
2
][
0
]
=
-
1
.
0
f
-
2
.
0
f
*
l
/
(
r
-
l
);
pout
->
m
[
2
][
1
]
=
1
.
0
f
+
2
.
0
f
*
t
/
(
b
-
t
);
pout
->
m
[
2
][
2
]
=
-
zf
/
(
zn
-
zf
);
pout
->
m
[
3
][
2
]
=
(
zn
*
zf
)
/
(
zn
-
zf
);
pout
->
m
[
2
][
3
]
=
1
.
0
f
;
pout
->
m
[
3
][
3
]
=
0
.
0
f
;
pout
->
u
.
m
[
0
][
0
]
=
2
.
0
f
*
zn
/
(
r
-
l
);
pout
->
u
.
m
[
1
][
1
]
=
-
2
.
0
f
*
zn
/
(
b
-
t
);
pout
->
u
.
m
[
2
][
0
]
=
-
1
.
0
f
-
2
.
0
f
*
l
/
(
r
-
l
);
pout
->
u
.
m
[
2
][
1
]
=
1
.
0
f
+
2
.
0
f
*
t
/
(
b
-
t
);
pout
->
u
.
m
[
2
][
2
]
=
-
zf
/
(
zn
-
zf
);
pout
->
u
.
m
[
3
][
2
]
=
(
zn
*
zf
)
/
(
zn
-
zf
);
pout
->
u
.
m
[
2
][
3
]
=
1
.
0
f
;
pout
->
u
.
m
[
3
][
3
]
=
0
.
0
f
;
return
pout
;
}
D3DXMATRIX
*
WINAPI
D3DXMatrixPerspectiveOffCenterRH
(
D3DXMATRIX
*
pout
,
FLOAT
l
,
FLOAT
r
,
FLOAT
b
,
FLOAT
t
,
FLOAT
zn
,
FLOAT
zf
)
{
D3DXMatrixIdentity
(
pout
);
pout
->
m
[
0
][
0
]
=
2
.
0
f
*
zn
/
(
r
-
l
);
pout
->
m
[
1
][
1
]
=
-
2
.
0
f
*
zn
/
(
b
-
t
);
pout
->
m
[
2
][
0
]
=
1
.
0
f
+
2
.
0
f
*
l
/
(
r
-
l
);
pout
->
m
[
2
][
1
]
=
-
1
.
0
f
-
2
.
0
f
*
t
/
(
b
-
t
);
pout
->
m
[
2
][
2
]
=
zf
/
(
zn
-
zf
);
pout
->
m
[
3
][
2
]
=
(
zn
*
zf
)
/
(
zn
-
zf
);
pout
->
m
[
2
][
3
]
=
-
1
.
0
f
;
pout
->
m
[
3
][
3
]
=
0
.
0
f
;
pout
->
u
.
m
[
0
][
0
]
=
2
.
0
f
*
zn
/
(
r
-
l
);
pout
->
u
.
m
[
1
][
1
]
=
-
2
.
0
f
*
zn
/
(
b
-
t
);
pout
->
u
.
m
[
2
][
0
]
=
1
.
0
f
+
2
.
0
f
*
l
/
(
r
-
l
);
pout
->
u
.
m
[
2
][
1
]
=
-
1
.
0
f
-
2
.
0
f
*
t
/
(
b
-
t
);
pout
->
u
.
m
[
2
][
2
]
=
zf
/
(
zn
-
zf
);
pout
->
u
.
m
[
3
][
2
]
=
(
zn
*
zf
)
/
(
zn
-
zf
);
pout
->
u
.
m
[
2
][
3
]
=
-
1
.
0
f
;
pout
->
u
.
m
[
3
][
3
]
=
0
.
0
f
;
return
pout
;
}
D3DXMATRIX
*
WINAPI
D3DXMatrixPerspectiveRH
(
D3DXMATRIX
*
pout
,
FLOAT
w
,
FLOAT
h
,
FLOAT
zn
,
FLOAT
zf
)
{
D3DXMatrixIdentity
(
pout
);
pout
->
m
[
0
][
0
]
=
2
.
0
f
*
zn
/
w
;
pout
->
m
[
1
][
1
]
=
2
.
0
f
*
zn
/
h
;
pout
->
m
[
2
][
2
]
=
zf
/
(
zn
-
zf
);
pout
->
m
[
3
][
2
]
=
(
zn
*
zf
)
/
(
zn
-
zf
);
pout
->
m
[
2
][
3
]
=
-
1
.
0
f
;
pout
->
m
[
3
][
3
]
=
0
.
0
f
;
pout
->
u
.
m
[
0
][
0
]
=
2
.
0
f
*
zn
/
w
;
pout
->
u
.
m
[
1
][
1
]
=
2
.
0
f
*
zn
/
h
;
pout
->
u
.
m
[
2
][
2
]
=
zf
/
(
zn
-
zf
);
pout
->
u
.
m
[
3
][
2
]
=
(
zn
*
zf
)
/
(
zn
-
zf
);
pout
->
u
.
m
[
2
][
3
]
=
-
1
.
0
f
;
pout
->
u
.
m
[
3
][
3
]
=
0
.
0
f
;
return
pout
;
}
...
...
@@ -242,50 +245,50 @@ D3DXMATRIX* WINAPI D3DXMatrixRotationAxis(D3DXMATRIX *pout, CONST D3DXVECTOR3 *p
D3DXVec3Normalize
(
&
v
,
pv
);
D3DXMatrixIdentity
(
pout
);
pout
->
m
[
0
][
0
]
=
(
1
.
0
f
-
cos
(
angle
))
*
v
.
x
*
v
.
x
+
cos
(
angle
);
pout
->
m
[
1
][
0
]
=
(
1
.
0
f
-
cos
(
angle
))
*
v
.
x
*
v
.
y
-
sin
(
angle
)
*
v
.
z
;
pout
->
m
[
2
][
0
]
=
(
1
.
0
f
-
cos
(
angle
))
*
v
.
x
*
v
.
z
+
sin
(
angle
)
*
v
.
y
;
pout
->
m
[
0
][
1
]
=
(
1
.
0
f
-
cos
(
angle
))
*
v
.
y
*
v
.
x
+
sin
(
angle
)
*
v
.
z
;
pout
->
m
[
1
][
1
]
=
(
1
.
0
f
-
cos
(
angle
))
*
v
.
y
*
v
.
y
+
cos
(
angle
);
pout
->
m
[
2
][
1
]
=
(
1
.
0
f
-
cos
(
angle
))
*
v
.
y
*
v
.
z
-
sin
(
angle
)
*
v
.
x
;
pout
->
m
[
0
][
2
]
=
(
1
.
0
f
-
cos
(
angle
))
*
v
.
z
*
v
.
x
-
sin
(
angle
)
*
v
.
y
;
pout
->
m
[
1
][
2
]
=
(
1
.
0
f
-
cos
(
angle
))
*
v
.
z
*
v
.
y
+
sin
(
angle
)
*
v
.
x
;
pout
->
m
[
2
][
2
]
=
(
1
.
0
f
-
cos
(
angle
))
*
v
.
z
*
v
.
z
+
cos
(
angle
);
pout
->
u
.
m
[
0
][
0
]
=
(
1
.
0
f
-
cos
(
angle
))
*
v
.
x
*
v
.
x
+
cos
(
angle
);
pout
->
u
.
m
[
1
][
0
]
=
(
1
.
0
f
-
cos
(
angle
))
*
v
.
x
*
v
.
y
-
sin
(
angle
)
*
v
.
z
;
pout
->
u
.
m
[
2
][
0
]
=
(
1
.
0
f
-
cos
(
angle
))
*
v
.
x
*
v
.
z
+
sin
(
angle
)
*
v
.
y
;
pout
->
u
.
m
[
0
][
1
]
=
(
1
.
0
f
-
cos
(
angle
))
*
v
.
y
*
v
.
x
+
sin
(
angle
)
*
v
.
z
;
pout
->
u
.
m
[
1
][
1
]
=
(
1
.
0
f
-
cos
(
angle
))
*
v
.
y
*
v
.
y
+
cos
(
angle
);
pout
->
u
.
m
[
2
][
1
]
=
(
1
.
0
f
-
cos
(
angle
))
*
v
.
y
*
v
.
z
-
sin
(
angle
)
*
v
.
x
;
pout
->
u
.
m
[
0
][
2
]
=
(
1
.
0
f
-
cos
(
angle
))
*
v
.
z
*
v
.
x
-
sin
(
angle
)
*
v
.
y
;
pout
->
u
.
m
[
1
][
2
]
=
(
1
.
0
f
-
cos
(
angle
))
*
v
.
z
*
v
.
y
+
sin
(
angle
)
*
v
.
x
;
pout
->
u
.
m
[
2
][
2
]
=
(
1
.
0
f
-
cos
(
angle
))
*
v
.
z
*
v
.
z
+
cos
(
angle
);
return
pout
;
}
D3DXMATRIX
*
WINAPI
D3DXMatrixRotationQuaternion
(
D3DXMATRIX
*
pout
,
CONST
D3DXQUATERNION
*
pq
)
{
D3DXMatrixIdentity
(
pout
);
pout
->
m
[
0
][
0
]
=
1
.
0
f
-
2
.
0
f
*
(
pq
->
y
*
pq
->
y
+
pq
->
z
*
pq
->
z
);
pout
->
m
[
0
][
1
]
=
2
.
0
f
*
(
pq
->
x
*
pq
->
y
+
pq
->
z
*
pq
->
w
);
pout
->
m
[
0
][
2
]
=
2
.
0
f
*
(
pq
->
x
*
pq
->
z
-
pq
->
y
*
pq
->
w
);
pout
->
m
[
1
][
0
]
=
2
.
0
f
*
(
pq
->
x
*
pq
->
y
-
pq
->
z
*
pq
->
w
);
pout
->
m
[
1
][
1
]
=
1
.
0
f
-
2
.
0
f
*
(
pq
->
x
*
pq
->
x
+
pq
->
z
*
pq
->
z
);
pout
->
m
[
1
][
2
]
=
2
.
0
f
*
(
pq
->
y
*
pq
->
z
+
pq
->
x
*
pq
->
w
);
pout
->
m
[
2
][
0
]
=
2
.
0
f
*
(
pq
->
x
*
pq
->
z
+
pq
->
y
*
pq
->
w
);
pout
->
m
[
2
][
1
]
=
2
.
0
f
*
(
pq
->
y
*
pq
->
z
-
pq
->
x
*
pq
->
w
);
pout
->
m
[
2
][
2
]
=
1
.
0
f
-
2
.
0
f
*
(
pq
->
x
*
pq
->
x
+
pq
->
y
*
pq
->
y
);
pout
->
u
.
m
[
0
][
0
]
=
1
.
0
f
-
2
.
0
f
*
(
pq
->
y
*
pq
->
y
+
pq
->
z
*
pq
->
z
);
pout
->
u
.
m
[
0
][
1
]
=
2
.
0
f
*
(
pq
->
x
*
pq
->
y
+
pq
->
z
*
pq
->
w
);
pout
->
u
.
m
[
0
][
2
]
=
2
.
0
f
*
(
pq
->
x
*
pq
->
z
-
pq
->
y
*
pq
->
w
);
pout
->
u
.
m
[
1
][
0
]
=
2
.
0
f
*
(
pq
->
x
*
pq
->
y
-
pq
->
z
*
pq
->
w
);
pout
->
u
.
m
[
1
][
1
]
=
1
.
0
f
-
2
.
0
f
*
(
pq
->
x
*
pq
->
x
+
pq
->
z
*
pq
->
z
);
pout
->
u
.
m
[
1
][
2
]
=
2
.
0
f
*
(
pq
->
y
*
pq
->
z
+
pq
->
x
*
pq
->
w
);
pout
->
u
.
m
[
2
][
0
]
=
2
.
0
f
*
(
pq
->
x
*
pq
->
z
+
pq
->
y
*
pq
->
w
);
pout
->
u
.
m
[
2
][
1
]
=
2
.
0
f
*
(
pq
->
y
*
pq
->
z
-
pq
->
x
*
pq
->
w
);
pout
->
u
.
m
[
2
][
2
]
=
1
.
0
f
-
2
.
0
f
*
(
pq
->
x
*
pq
->
x
+
pq
->
y
*
pq
->
y
);
return
pout
;
}
D3DXMATRIX
*
WINAPI
D3DXMatrixRotationX
(
D3DXMATRIX
*
pout
,
FLOAT
angle
)
{
D3DXMatrixIdentity
(
pout
);
pout
->
m
[
1
][
1
]
=
cos
(
angle
);
pout
->
m
[
2
][
2
]
=
cos
(
angle
);
pout
->
m
[
1
][
2
]
=
sin
(
angle
);
pout
->
m
[
2
][
1
]
=
-
sin
(
angle
);
pout
->
u
.
m
[
1
][
1
]
=
cos
(
angle
);
pout
->
u
.
m
[
2
][
2
]
=
cos
(
angle
);
pout
->
u
.
m
[
1
][
2
]
=
sin
(
angle
);
pout
->
u
.
m
[
2
][
1
]
=
-
sin
(
angle
);
return
pout
;
}
D3DXMATRIX
*
WINAPI
D3DXMatrixRotationY
(
D3DXMATRIX
*
pout
,
FLOAT
angle
)
{
D3DXMatrixIdentity
(
pout
);
pout
->
m
[
0
][
0
]
=
cos
(
angle
);
pout
->
m
[
2
][
2
]
=
cos
(
angle
);
pout
->
m
[
0
][
2
]
=
-
sin
(
angle
);
pout
->
m
[
2
][
0
]
=
sin
(
angle
);
pout
->
u
.
m
[
0
][
0
]
=
cos
(
angle
);
pout
->
u
.
m
[
2
][
2
]
=
cos
(
angle
);
pout
->
u
.
m
[
0
][
2
]
=
-
sin
(
angle
);
pout
->
u
.
m
[
2
][
0
]
=
sin
(
angle
);
return
pout
;
}
...
...
@@ -305,28 +308,28 @@ D3DXMATRIX* WINAPI D3DXMatrixRotationYawPitchRoll(D3DXMATRIX *pout, FLOAT yaw, F
D3DXMATRIX
*
WINAPI
D3DXMatrixRotationZ
(
D3DXMATRIX
*
pout
,
FLOAT
angle
)
{
D3DXMatrixIdentity
(
pout
);
pout
->
m
[
0
][
0
]
=
cos
(
angle
);
pout
->
m
[
1
][
1
]
=
cos
(
angle
);
pout
->
m
[
0
][
1
]
=
sin
(
angle
);
pout
->
m
[
1
][
0
]
=
-
sin
(
angle
);
pout
->
u
.
m
[
0
][
0
]
=
cos
(
angle
);
pout
->
u
.
m
[
1
][
1
]
=
cos
(
angle
);
pout
->
u
.
m
[
0
][
1
]
=
sin
(
angle
);
pout
->
u
.
m
[
1
][
0
]
=
-
sin
(
angle
);
return
pout
;
}
D3DXMATRIX
*
WINAPI
D3DXMatrixScaling
(
D3DXMATRIX
*
pout
,
FLOAT
sx
,
FLOAT
sy
,
FLOAT
sz
)
{
D3DXMatrixIdentity
(
pout
);
pout
->
m
[
0
][
0
]
=
sx
;
pout
->
m
[
1
][
1
]
=
sy
;
pout
->
m
[
2
][
2
]
=
sz
;
pout
->
u
.
m
[
0
][
0
]
=
sx
;
pout
->
u
.
m
[
1
][
1
]
=
sy
;
pout
->
u
.
m
[
2
][
2
]
=
sz
;
return
pout
;
}
D3DXMATRIX
*
WINAPI
D3DXMatrixTranslation
(
D3DXMATRIX
*
pout
,
FLOAT
x
,
FLOAT
y
,
FLOAT
z
)
{
D3DXMatrixIdentity
(
pout
);
pout
->
m
[
3
][
0
]
=
x
;
pout
->
m
[
3
][
1
]
=
y
;
pout
->
m
[
3
][
2
]
=
z
;
pout
->
u
.
m
[
3
][
0
]
=
x
;
pout
->
u
.
m
[
3
][
1
]
=
y
;
pout
->
u
.
m
[
3
][
2
]
=
z
;
return
pout
;
}
...
...
@@ -338,7 +341,7 @@ D3DXMATRIX* WINAPI D3DXMatrixTranspose(D3DXMATRIX *pout, CONST D3DXMATRIX *pm)
{
for
(
j
=
0
;
j
<
4
;
j
++
)
{
pout
->
m
[
i
][
j
]
=
pm
->
m
[
j
][
i
];
pout
->
u
.
m
[
i
][
j
]
=
pm
->
u
.
m
[
j
][
i
];
}
}
return
pout
;
...
...
@@ -417,10 +420,10 @@ D3DXVECTOR2* WINAPI D3DXVec2Normalize(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv)
D3DXVECTOR4
*
WINAPI
D3DXVec2Transform
(
D3DXVECTOR4
*
pout
,
CONST
D3DXVECTOR2
*
pv
,
CONST
D3DXMATRIX
*
pm
)
{
pout
->
x
=
pm
->
m
[
0
][
0
]
*
pv
->
x
+
pm
->
m
[
1
][
0
]
*
pv
->
y
+
pm
->
m
[
3
][
0
];
pout
->
y
=
pm
->
m
[
0
][
1
]
*
pv
->
x
+
pm
->
m
[
1
][
1
]
*
pv
->
y
+
pm
->
m
[
3
][
1
];
pout
->
z
=
pm
->
m
[
0
][
2
]
*
pv
->
x
+
pm
->
m
[
1
][
2
]
*
pv
->
y
+
pm
->
m
[
3
][
2
];
pout
->
w
=
pm
->
m
[
0
][
3
]
*
pv
->
x
+
pm
->
m
[
1
][
3
]
*
pv
->
y
+
pm
->
m
[
3
][
3
];
pout
->
x
=
pm
->
u
.
m
[
0
][
0
]
*
pv
->
x
+
pm
->
u
.
m
[
1
][
0
]
*
pv
->
y
+
pm
->
u
.
m
[
3
][
0
];
pout
->
y
=
pm
->
u
.
m
[
0
][
1
]
*
pv
->
x
+
pm
->
u
.
m
[
1
][
1
]
*
pv
->
y
+
pm
->
u
.
m
[
3
][
1
];
pout
->
z
=
pm
->
u
.
m
[
0
][
2
]
*
pv
->
x
+
pm
->
u
.
m
[
1
][
2
]
*
pv
->
y
+
pm
->
u
.
m
[
3
][
2
];
pout
->
w
=
pm
->
u
.
m
[
0
][
3
]
*
pv
->
x
+
pm
->
u
.
m
[
1
][
3
]
*
pv
->
y
+
pm
->
u
.
m
[
3
][
3
];
return
pout
;
}
...
...
@@ -428,11 +431,11 @@ D3DXVECTOR2* WINAPI D3DXVec2TransformCoord(D3DXVECTOR2 *pout, CONST D3DXVECTOR2
{
FLOAT
norm
;
norm
=
pm
->
m
[
0
][
3
]
*
pv
->
x
+
pm
->
m
[
1
][
3
]
*
pv
->
y
+
pm
->
m
[
3
][
3
];
norm
=
pm
->
u
.
m
[
0
][
3
]
*
pv
->
x
+
pm
->
u
.
m
[
1
][
3
]
*
pv
->
y
+
pm
->
u
.
m
[
3
][
3
];
if
(
norm
)
{
pout
->
x
=
(
pm
->
m
[
0
][
0
]
*
pv
->
x
+
pm
->
m
[
1
][
0
]
*
pv
->
y
+
pm
->
m
[
3
][
0
])
/
norm
;
pout
->
y
=
(
pm
->
m
[
0
][
1
]
*
pv
->
x
+
pm
->
m
[
1
][
1
]
*
pv
->
y
+
pm
->
m
[
3
][
1
])
/
norm
;
pout
->
x
=
(
pm
->
u
.
m
[
0
][
0
]
*
pv
->
x
+
pm
->
u
.
m
[
1
][
0
]
*
pv
->
y
+
pm
->
u
.
m
[
3
][
0
])
/
norm
;
pout
->
y
=
(
pm
->
u
.
m
[
0
][
1
]
*
pv
->
x
+
pm
->
u
.
m
[
1
][
1
]
*
pv
->
y
+
pm
->
u
.
m
[
3
][
1
])
/
norm
;
}
else
{
...
...
@@ -444,8 +447,8 @@ D3DXVECTOR2* WINAPI D3DXVec2TransformCoord(D3DXVECTOR2 *pout, CONST D3DXVECTOR2
D3DXVECTOR2
*
WINAPI
D3DXVec2TransformNormal
(
D3DXVECTOR2
*
pout
,
CONST
D3DXVECTOR2
*
pv
,
CONST
D3DXMATRIX
*
pm
)
{
pout
->
x
=
pm
->
m
[
0
][
0
]
*
pv
->
x
+
pm
->
m
[
1
][
0
]
*
pv
->
y
;
pout
->
y
=
pm
->
m
[
0
][
1
]
*
pv
->
x
+
pm
->
m
[
1
][
1
]
*
pv
->
y
;
pout
->
x
=
pm
->
u
.
m
[
0
][
0
]
*
pv
->
x
+
pm
->
u
.
m
[
1
][
0
]
*
pv
->
y
;
pout
->
y
=
pm
->
u
.
m
[
0
][
1
]
*
pv
->
x
+
pm
->
u
.
m
[
1
][
1
]
*
pv
->
y
;
return
pout
;
}
...
...
@@ -504,10 +507,10 @@ D3DXVECTOR3* WINAPI D3DXVec3Normalize(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv)
D3DXVECTOR4
*
WINAPI
D3DXVec3Transform
(
D3DXVECTOR4
*
pout
,
CONST
D3DXVECTOR3
*
pv
,
CONST
D3DXMATRIX
*
pm
)
{
pout
->
x
=
pm
->
m
[
0
][
0
]
*
pv
->
x
+
pm
->
m
[
1
][
0
]
*
pv
->
y
+
pm
->
m
[
2
][
0
]
*
pv
->
z
+
pm
->
m
[
3
][
0
];
pout
->
y
=
pm
->
m
[
0
][
1
]
*
pv
->
x
+
pm
->
m
[
1
][
1
]
*
pv
->
y
+
pm
->
m
[
2
][
1
]
*
pv
->
z
+
pm
->
m
[
3
][
1
];
pout
->
z
=
pm
->
m
[
0
][
2
]
*
pv
->
x
+
pm
->
m
[
1
][
2
]
*
pv
->
y
+
pm
->
m
[
2
][
2
]
*
pv
->
z
+
pm
->
m
[
3
][
2
];
pout
->
w
=
pm
->
m
[
0
][
3
]
*
pv
->
x
+
pm
->
m
[
1
][
3
]
*
pv
->
y
+
pm
->
m
[
2
][
3
]
*
pv
->
z
+
pm
->
m
[
3
][
3
];
pout
->
x
=
pm
->
u
.
m
[
0
][
0
]
*
pv
->
x
+
pm
->
u
.
m
[
1
][
0
]
*
pv
->
y
+
pm
->
u
.
m
[
2
][
0
]
*
pv
->
z
+
pm
->
u
.
m
[
3
][
0
];
pout
->
y
=
pm
->
u
.
m
[
0
][
1
]
*
pv
->
x
+
pm
->
u
.
m
[
1
][
1
]
*
pv
->
y
+
pm
->
u
.
m
[
2
][
1
]
*
pv
->
z
+
pm
->
u
.
m
[
3
][
1
];
pout
->
z
=
pm
->
u
.
m
[
0
][
2
]
*
pv
->
x
+
pm
->
u
.
m
[
1
][
2
]
*
pv
->
y
+
pm
->
u
.
m
[
2
][
2
]
*
pv
->
z
+
pm
->
u
.
m
[
3
][
2
];
pout
->
w
=
pm
->
u
.
m
[
0
][
3
]
*
pv
->
x
+
pm
->
u
.
m
[
1
][
3
]
*
pv
->
y
+
pm
->
u
.
m
[
2
][
3
]
*
pv
->
z
+
pm
->
u
.
m
[
3
][
3
];
return
pout
;
}
...
...
@@ -515,13 +518,13 @@ D3DXVECTOR3* WINAPI D3DXVec3TransformCoord(D3DXVECTOR3 *pout, CONST D3DXVECTOR3
{
FLOAT
norm
;
norm
=
pm
->
m
[
0
][
3
]
*
pv
->
x
+
pm
->
m
[
1
][
3
]
*
pv
->
y
+
pm
->
m
[
2
][
3
]
*
pv
->
z
+
pm
->
m
[
3
][
3
];
norm
=
pm
->
u
.
m
[
0
][
3
]
*
pv
->
x
+
pm
->
u
.
m
[
1
][
3
]
*
pv
->
y
+
pm
->
u
.
m
[
2
][
3
]
*
pv
->
z
+
pm
->
u
.
m
[
3
][
3
];
if
(
norm
)
{
pout
->
x
=
(
pm
->
m
[
0
][
0
]
*
pv
->
x
+
pm
->
m
[
1
][
0
]
*
pv
->
y
+
pm
->
m
[
2
][
0
]
*
pv
->
z
+
pm
->
m
[
3
][
0
])
/
norm
;
pout
->
y
=
(
pm
->
m
[
0
][
1
]
*
pv
->
x
+
pm
->
m
[
1
][
1
]
*
pv
->
y
+
pm
->
m
[
2
][
1
]
*
pv
->
z
+
pm
->
m
[
3
][
1
])
/
norm
;
pout
->
z
=
(
pm
->
m
[
0
][
2
]
*
pv
->
x
+
pm
->
m
[
1
][
2
]
*
pv
->
y
+
pm
->
m
[
2
][
2
]
*
pv
->
z
+
pm
->
m
[
3
][
2
])
/
norm
;
pout
->
x
=
(
pm
->
u
.
m
[
0
][
0
]
*
pv
->
x
+
pm
->
u
.
m
[
1
][
0
]
*
pv
->
y
+
pm
->
u
.
m
[
2
][
0
]
*
pv
->
z
+
pm
->
u
.
m
[
3
][
0
])
/
norm
;
pout
->
y
=
(
pm
->
u
.
m
[
0
][
1
]
*
pv
->
x
+
pm
->
u
.
m
[
1
][
1
]
*
pv
->
y
+
pm
->
u
.
m
[
2
][
1
]
*
pv
->
z
+
pm
->
u
.
m
[
3
][
1
])
/
norm
;
pout
->
z
=
(
pm
->
u
.
m
[
0
][
2
]
*
pv
->
x
+
pm
->
u
.
m
[
1
][
2
]
*
pv
->
y
+
pm
->
u
.
m
[
2
][
2
]
*
pv
->
z
+
pm
->
u
.
m
[
3
][
2
])
/
norm
;
}
else
{
...
...
@@ -534,9 +537,9 @@ D3DXVECTOR3* WINAPI D3DXVec3TransformCoord(D3DXVECTOR3 *pout, CONST D3DXVECTOR3
D3DXVECTOR3
*
WINAPI
D3DXVec3TransformNormal
(
D3DXVECTOR3
*
pout
,
CONST
D3DXVECTOR3
*
pv
,
CONST
D3DXMATRIX
*
pm
)
{
pout
->
x
=
pm
->
m
[
0
][
0
]
*
pv
->
x
+
pm
->
m
[
1
][
0
]
*
pv
->
y
+
pm
->
m
[
2
][
0
]
*
pv
->
z
;
pout
->
y
=
pm
->
m
[
0
][
1
]
*
pv
->
x
+
pm
->
m
[
1
][
1
]
*
pv
->
y
+
pm
->
m
[
2
][
1
]
*
pv
->
z
;
pout
->
z
=
pm
->
m
[
0
][
2
]
*
pv
->
x
+
pm
->
m
[
1
][
2
]
*
pv
->
y
+
pm
->
m
[
2
][
2
]
*
pv
->
z
;
pout
->
x
=
pm
->
u
.
m
[
0
][
0
]
*
pv
->
x
+
pm
->
u
.
m
[
1
][
0
]
*
pv
->
y
+
pm
->
u
.
m
[
2
][
0
]
*
pv
->
z
;
pout
->
y
=
pm
->
u
.
m
[
0
][
1
]
*
pv
->
x
+
pm
->
u
.
m
[
1
][
1
]
*
pv
->
y
+
pm
->
u
.
m
[
2
][
1
]
*
pv
->
z
;
pout
->
z
=
pm
->
u
.
m
[
0
][
2
]
*
pv
->
x
+
pm
->
u
.
m
[
1
][
2
]
*
pv
->
y
+
pm
->
u
.
m
[
2
][
2
]
*
pv
->
z
;
return
pout
;
}
...
...
@@ -610,9 +613,9 @@ D3DXVECTOR4* WINAPI D3DXVec4Normalize(D3DXVECTOR4 *pout, CONST D3DXVECTOR4 *pv)
D3DXVECTOR4
*
WINAPI
D3DXVec4Transform
(
D3DXVECTOR4
*
pout
,
CONST
D3DXVECTOR4
*
pv
,
CONST
D3DXMATRIX
*
pm
)
{
pout
->
x
=
pm
->
m
[
0
][
0
]
*
pv
->
x
+
pm
->
m
[
1
][
0
]
*
pv
->
y
+
pm
->
m
[
2
][
0
]
*
pv
->
z
+
pm
->
m
[
3
][
0
]
*
pv
->
w
;
pout
->
y
=
pm
->
m
[
0
][
1
]
*
pv
->
x
+
pm
->
m
[
1
][
1
]
*
pv
->
y
+
pm
->
m
[
2
][
1
]
*
pv
->
z
+
pm
->
m
[
3
][
1
]
*
pv
->
w
;
pout
->
z
=
pm
->
m
[
0
][
2
]
*
pv
->
x
+
pm
->
m
[
1
][
2
]
*
pv
->
y
+
pm
->
m
[
2
][
2
]
*
pv
->
z
+
pm
->
m
[
3
][
2
]
*
pv
->
w
;
pout
->
w
=
pm
->
m
[
0
][
3
]
*
pv
->
x
+
pm
->
m
[
1
][
3
]
*
pv
->
y
+
pm
->
m
[
2
][
3
]
*
pv
->
z
+
pm
->
m
[
3
][
3
]
*
pv
->
w
;
pout
->
x
=
pm
->
u
.
m
[
0
][
0
]
*
pv
->
x
+
pm
->
u
.
m
[
1
][
0
]
*
pv
->
y
+
pm
->
u
.
m
[
2
][
0
]
*
pv
->
z
+
pm
->
u
.
m
[
3
][
0
]
*
pv
->
w
;
pout
->
y
=
pm
->
u
.
m
[
0
][
1
]
*
pv
->
x
+
pm
->
u
.
m
[
1
][
1
]
*
pv
->
y
+
pm
->
u
.
m
[
2
][
1
]
*
pv
->
z
+
pm
->
u
.
m
[
3
][
1
]
*
pv
->
w
;
pout
->
z
=
pm
->
u
.
m
[
0
][
2
]
*
pv
->
x
+
pm
->
u
.
m
[
1
][
2
]
*
pv
->
y
+
pm
->
u
.
m
[
2
][
2
]
*
pv
->
z
+
pm
->
u
.
m
[
3
][
2
]
*
pv
->
w
;
pout
->
w
=
pm
->
u
.
m
[
0
][
3
]
*
pv
->
x
+
pm
->
u
.
m
[
1
][
3
]
*
pv
->
y
+
pm
->
u
.
m
[
2
][
3
]
*
pv
->
z
+
pm
->
u
.
m
[
3
][
3
]
*
pv
->
w
;
return
pout
;
}
dlls/d3dx8/tests/math.c
View file @
8fc8f262
...
...
@@ -32,7 +32,7 @@
{\
for (j=0; j<4; j++)\
{\
if (fabs(expectedmat.m[i][j]-gotmat.m[i][j])>admitted_error)
\
if (fabs(U(expectedmat).m[i][j]-U(gotmat).m[i][j])>admitted_error)
\
{\
equal=0;\
}\
...
...
@@ -40,14 +40,14 @@
}\
ok(equal, "Expected matrix=\n(%f,%f,%f,%f\n %f,%f,%f,%f\n %f,%f,%f,%f\n %f,%f,%f,%f\n)\n\n" \
"Got matrix=\n(%f,%f,%f,%f\n %f,%f,%f,%f\n %f,%f,%f,%f\n %f,%f,%f,%f)\n", \
expectedmat.m[0][0],expectedmat.m[0][1],expectedmat.m[0][2],expectedmat
.m[0][3], \
expectedmat.m[1][0],expectedmat.m[1][1],expectedmat.m[1][2],expectedmat
.m[1][3], \
expectedmat.m[2][0],expectedmat.m[2][1],expectedmat.m[2][2],expectedmat
.m[2][3], \
expectedmat.m[3][0],expectedmat.m[3][1],expectedmat.m[3][2],expectedmat
.m[3][3], \
gotmat.m[0][0],gotmat.m[0][1],gotmat.m[0][2],gotmat
.m[0][3], \
gotmat.m[1][0],gotmat.m[1][1],gotmat.m[1][2],gotmat
.m[1][3], \
gotmat.m[2][0],gotmat.m[2][1],gotmat.m[2][2],gotmat
.m[2][3], \
gotmat.m[3][0],gotmat.m[3][1],gotmat.m[3][2],gotmat
.m[3][3]); \
U(expectedmat).m[0][0],U(expectedmat).m[0][1],U(expectedmat).m[0][2],U(expectedmat)
.m[0][3], \
U(expectedmat).m[1][0],U(expectedmat).m[1][1],U(expectedmat).m[1][2],U(expectedmat)
.m[1][3], \
U(expectedmat).m[2][0],U(expectedmat).m[2][1],U(expectedmat).m[2][2],U(expectedmat)
.m[2][3], \
U(expectedmat).m[3][0],U(expectedmat).m[3][1],U(expectedmat).m[3][2],U(expectedmat)
.m[3][3], \
U(gotmat).m[0][0],U(gotmat).m[0][1],U(gotmat).m[0][2],U(gotmat)
.m[0][3], \
U(gotmat).m[1][0],U(gotmat).m[1][1],U(gotmat).m[1][2],U(gotmat)
.m[1][3], \
U(gotmat).m[2][0],U(gotmat).m[2][1],U(gotmat).m[2][2],U(gotmat)
.m[2][3], \
U(gotmat).m[3][0],U(gotmat).m[3][1],U(gotmat).m[3][2],U(gotmat)
.m[3][3]); \
}
#define expect_vec(expectedvec,gotvec) ok((fabs(expectedvec.x-gotvec.x)<admitted_error)&&(fabs(expectedvec.y-gotvec.y)<admitted_error),"Expected Vector= (%f, %f)\n , Got Vector= (%f, %f)\n", expectedvec.x, expectedvec.y, gotvec.x, gotvec.y);
...
...
@@ -161,12 +161,12 @@ static void D3DXMatrixTest(void)
U
(
mat
).
m
[
0
][
0
]
=
10
.
0
f
;
U
(
mat
).
m
[
1
][
1
]
=
20
.
0
f
;
U
(
mat
).
m
[
2
][
2
]
=
30
.
0
f
;
U
(
mat
).
m
[
3
][
3
]
=
-
40
.
0
f
;
mat2
.
m
[
0
][
0
]
=
1
.
0
f
;
mat2
.
m
[
1
][
0
]
=
2
.
0
f
;
mat2
.
m
[
2
][
0
]
=
3
.
0
f
;
mat2
.
m
[
3
][
0
]
=
4
.
0
f
;
mat2
.
m
[
0
][
1
]
=
5
.
0
f
;
mat2
.
m
[
1
][
1
]
=
6
.
0
f
;
mat2
.
m
[
2
][
1
]
=
7
.
0
f
;
mat2
.
m
[
3
][
1
]
=
8
.
0
f
;
mat2
.
m
[
0
][
2
]
=
-
8
.
0
f
;
mat2
.
m
[
1
][
2
]
=
-
7
.
0
f
;
mat2
.
m
[
2
][
2
]
=
-
6
.
0
f
;
mat2
.
m
[
3
][
2
]
=
-
5
.
0
f
;
mat2
.
m
[
0
][
3
]
=
-
4
.
0
f
;
mat2
.
m
[
1
][
3
]
=
-
3
.
0
f
;
mat2
.
m
[
2
][
3
]
=
-
2
.
0
f
;
mat2
.
m
[
3
][
3
]
=
-
1
.
0
f
;
U
(
mat2
).
m
[
0
][
0
]
=
1
.
0
f
;
U
(
mat2
).
m
[
1
][
0
]
=
2
.
0
f
;
U
(
mat2
)
.
m
[
2
][
0
]
=
3
.
0
f
;
U
(
mat2
).
m
[
3
][
0
]
=
4
.
0
f
;
U
(
mat2
).
m
[
0
][
1
]
=
5
.
0
f
;
U
(
mat2
)
.
m
[
1
][
1
]
=
6
.
0
f
;
U
(
mat2
).
m
[
2
][
1
]
=
7
.
0
f
;
U
(
mat2
).
m
[
3
][
1
]
=
8
.
0
f
;
U
(
mat2
)
.
m
[
0
][
2
]
=
-
8
.
0
f
;
U
(
mat2
).
m
[
1
][
2
]
=
-
7
.
0
f
;
U
(
mat2
).
m
[
2
][
2
]
=
-
6
.
0
f
;
U
(
mat2
)
.
m
[
3
][
2
]
=
-
5
.
0
f
;
U
(
mat2
).
m
[
0
][
3
]
=
-
4
.
0
f
;
U
(
mat2
).
m
[
1
][
3
]
=
-
3
.
0
f
;
U
(
mat2
)
.
m
[
2
][
3
]
=
-
2
.
0
f
;
U
(
mat2
)
.
m
[
3
][
3
]
=
-
1
.
0
f
;
q
.
x
=
1
.
0
f
;
q
.
y
=
-
4
.
0
f
;
q
.
z
=
7
.
0
f
;
q
.
w
=
-
11
.
0
f
;
...
...
@@ -199,178 +199,178 @@ static void D3DXMatrixTest(void)
ok
(
expected
==
got
,
"Expected : %d, Got : %d
\n
"
,
expected
,
got
);
/*____________D3DXMatrixLookatLH_______________*/
expectedmat
.
m
[
0
][
0
]
=
-
0
.
822465
f
;
expectedmat
.
m
[
0
][
1
]
=
-
0
.
409489
f
;
expectedmat
.
m
[
0
][
2
]
=
-
0
.
394803
f
;
expectedmat
.
m
[
0
][
3
]
=
0
.
0
f
;
expectedmat
.
m
[
1
][
0
]
=
-
0
.
555856
f
;
expectedmat
.
m
[
1
][
1
]
=
0
.
431286
f
;
expectedmat
.
m
[
1
][
2
]
=
0
.
710645
f
;
expectedmat
.
m
[
1
][
3
]
=
0
.
0
f
;
expectedmat
.
m
[
2
][
0
]
=
-
0
.
120729
f
;
expectedmat
.
m
[
2
][
1
]
=
0
.
803935
f
;
expectedmat
.
m
[
2
][
2
]
=
-
0
.
582335
f
;
expectedmat
.
m
[
2
][
3
]
=
0
.
0
f
;
expectedmat
.
m
[
3
][
0
]
=
4
.
494634
f
;
expectedmat
.
m
[
3
][
1
]
=
0
.
809719
f
;
expectedmat
.
m
[
3
][
2
]
=
10
.
060076
f
;
expectedmat
.
m
[
3
][
3
]
=
1
.
0
f
;
U
(
expectedmat
).
m
[
0
][
0
]
=
-
0
.
822465
f
;
U
(
expectedmat
).
m
[
0
][
1
]
=
-
0
.
409489
f
;
U
(
expectedmat
).
m
[
0
][
2
]
=
-
0
.
394803
f
;
U
(
expectedmat
)
.
m
[
0
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
1
][
0
]
=
-
0
.
555856
f
;
U
(
expectedmat
).
m
[
1
][
1
]
=
0
.
431286
f
;
U
(
expectedmat
).
m
[
1
][
2
]
=
0
.
710645
f
;
U
(
expectedmat
)
.
m
[
1
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
2
][
0
]
=
-
0
.
120729
f
;
U
(
expectedmat
).
m
[
2
][
1
]
=
0
.
803935
f
;
U
(
expectedmat
).
m
[
2
][
2
]
=
-
0
.
582335
f
;
U
(
expectedmat
)
.
m
[
2
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
3
][
0
]
=
4
.
494634
f
;
U
(
expectedmat
).
m
[
3
][
1
]
=
0
.
809719
f
;
U
(
expectedmat
).
m
[
3
][
2
]
=
10
.
060076
f
;
U
(
expectedmat
)
.
m
[
3
][
3
]
=
1
.
0
f
;
D3DXMatrixLookAtLH
(
&
gotmat
,
&
eye
,
&
at
,
&
axis
);
expect_mat
(
expectedmat
,
gotmat
);
/*____________D3DXMatrixLookatRH_______________*/
expectedmat
.
m
[
0
][
0
]
=
0
.
822465
f
;
expectedmat
.
m
[
0
][
1
]
=
-
0
.
409489
f
;
expectedmat
.
m
[
0
][
2
]
=
0
.
394803
f
;
expectedmat
.
m
[
0
][
3
]
=
0
.
0
f
;
expectedmat
.
m
[
1
][
0
]
=
0
.
555856
f
;
expectedmat
.
m
[
1
][
1
]
=
0
.
431286
f
;
expectedmat
.
m
[
1
][
2
]
=
-
0
.
710645
f
;
expectedmat
.
m
[
1
][
3
]
=
0
.
0
f
;
expectedmat
.
m
[
2
][
0
]
=
0
.
120729
f
;
expectedmat
.
m
[
2
][
1
]
=
0
.
803935
f
;
expectedmat
.
m
[
2
][
2
]
=
0
.
582335
f
;
expectedmat
.
m
[
2
][
3
]
=
0
.
0
f
;
expectedmat
.
m
[
3
][
0
]
=
-
4
.
494634
f
;
expectedmat
.
m
[
3
][
1
]
=
0
.
809719
f
;
expectedmat
.
m
[
3
][
2
]
=
-
10
.
060076
f
;
expectedmat
.
m
[
3
][
3
]
=
1
.
0
f
;
U
(
expectedmat
).
m
[
0
][
0
]
=
0
.
822465
f
;
U
(
expectedmat
).
m
[
0
][
1
]
=
-
0
.
409489
f
;
U
(
expectedmat
).
m
[
0
][
2
]
=
0
.
394803
f
;
U
(
expectedmat
)
.
m
[
0
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
1
][
0
]
=
0
.
555856
f
;
U
(
expectedmat
).
m
[
1
][
1
]
=
0
.
431286
f
;
U
(
expectedmat
).
m
[
1
][
2
]
=
-
0
.
710645
f
;
U
(
expectedmat
)
.
m
[
1
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
2
][
0
]
=
0
.
120729
f
;
U
(
expectedmat
).
m
[
2
][
1
]
=
0
.
803935
f
;
U
(
expectedmat
).
m
[
2
][
2
]
=
0
.
582335
f
;
U
(
expectedmat
)
.
m
[
2
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
3
][
0
]
=
-
4
.
494634
f
;
U
(
expectedmat
).
m
[
3
][
1
]
=
0
.
809719
f
;
U
(
expectedmat
).
m
[
3
][
2
]
=
-
10
.
060076
f
;
U
(
expectedmat
)
.
m
[
3
][
3
]
=
1
.
0
f
;
D3DXMatrixLookAtRH
(
&
gotmat
,
&
eye
,
&
at
,
&
axis
);
expect_mat
(
expectedmat
,
gotmat
);
/*____________D3DXMatrixMultiply______________*/
expectedmat
.
m
[
0
][
0
]
=
73
.
0
f
;
expectedmat
.
m
[
0
][
1
]
=
193
.
0
f
;
expectedmat
.
m
[
0
][
2
]
=
-
197
.
0
f
;
expectedmat
.
m
[
0
][
3
]
=
-
77
.
0
f
;
expectedmat
.
m
[
1
][
0
]
=
231
.
0
f
;
expectedmat
.
m
[
1
][
1
]
=
551
.
0
f
;
expectedmat
.
m
[
1
][
2
]
=
-
489
.
0
f
;
expectedmat
.
m
[
1
][
3
]
=
-
169
.
0
;
expectedmat
.
m
[
2
][
0
]
=
239
.
0
f
;
expectedmat
.
m
[
2
][
1
]
=
523
.
0
f
;
expectedmat
.
m
[
2
][
2
]
=
-
400
.
0
f
;
expectedmat
.
m
[
2
][
3
]
=
-
116
.
0
f
;
expectedmat
.
m
[
3
][
0
]
=
-
164
.
0
f
;
expectedmat
.
m
[
3
][
1
]
=
-
320
.
0
f
;
expectedmat
.
m
[
3
][
2
]
=
187
.
0
f
;
expectedmat
.
m
[
3
][
3
]
=
31
.
0
f
;
U
(
expectedmat
).
m
[
0
][
0
]
=
73
.
0
f
;
U
(
expectedmat
).
m
[
0
][
1
]
=
193
.
0
f
;
U
(
expectedmat
).
m
[
0
][
2
]
=
-
197
.
0
f
;
U
(
expectedmat
)
.
m
[
0
][
3
]
=
-
77
.
0
f
;
U
(
expectedmat
).
m
[
1
][
0
]
=
231
.
0
f
;
U
(
expectedmat
).
m
[
1
][
1
]
=
551
.
0
f
;
U
(
expectedmat
).
m
[
1
][
2
]
=
-
489
.
0
f
;
U
(
expectedmat
)
.
m
[
1
][
3
]
=
-
169
.
0
;
U
(
expectedmat
).
m
[
2
][
0
]
=
239
.
0
f
;
U
(
expectedmat
).
m
[
2
][
1
]
=
523
.
0
f
;
U
(
expectedmat
).
m
[
2
][
2
]
=
-
400
.
0
f
;
U
(
expectedmat
)
.
m
[
2
][
3
]
=
-
116
.
0
f
;
U
(
expectedmat
).
m
[
3
][
0
]
=
-
164
.
0
f
;
U
(
expectedmat
).
m
[
3
][
1
]
=
-
320
.
0
f
;
U
(
expectedmat
).
m
[
3
][
2
]
=
187
.
0
f
;
U
(
expectedmat
)
.
m
[
3
][
3
]
=
31
.
0
f
;
D3DXMatrixMultiply
(
&
gotmat
,
&
mat
,
&
mat2
);
expect_mat
(
expectedmat
,
gotmat
);
/*____________D3DXMatrixOrthoLH_______________*/
expectedmat
.
m
[
0
][
0
]
=
0
.
8
f
;
expectedmat
.
m
[
0
][
1
]
=
0
.
0
f
;
expectedmat
.
m
[
0
][
2
]
=
0
.
0
f
;
expectedmat
.
m
[
0
][
3
]
=
0
.
0
f
;
expectedmat
.
m
[
1
][
0
]
=
0
.
0
f
;
expectedmat
.
m
[
1
][
1
]
=
0
.
270270
f
;
expectedmat
.
m
[
1
][
2
]
=
0
.
0
f
;
expectedmat
.
m
[
1
][
3
]
=
0
.
0
f
;
expectedmat
.
m
[
2
][
0
]
=
0
.
0
f
;
expectedmat
.
m
[
2
][
1
]
=
0
.
0
f
;
expectedmat
.
m
[
2
][
2
]
=
-
0
.
151515
f
;
expectedmat
.
m
[
2
][
3
]
=
0
.
0
f
;
expectedmat
.
m
[
3
][
0
]
=
0
.
0
f
;
expectedmat
.
m
[
3
][
1
]
=
0
.
0
f
;
expectedmat
.
m
[
3
][
2
]
=
-
0
.
484848
f
;
expectedmat
.
m
[
3
][
3
]
=
1
.
0
f
;
U
(
expectedmat
).
m
[
0
][
0
]
=
0
.
8
f
;
U
(
expectedmat
).
m
[
0
][
1
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
0
][
2
]
=
0
.
0
f
;
U
(
expectedmat
)
.
m
[
0
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
1
][
0
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
1
][
1
]
=
0
.
270270
f
;
U
(
expectedmat
).
m
[
1
][
2
]
=
0
.
0
f
;
U
(
expectedmat
)
.
m
[
1
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
2
][
0
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
2
][
1
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
2
][
2
]
=
-
0
.
151515
f
;
U
(
expectedmat
)
.
m
[
2
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
3
][
0
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
3
][
1
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
3
][
2
]
=
-
0
.
484848
f
;
U
(
expectedmat
)
.
m
[
3
][
3
]
=
1
.
0
f
;
D3DXMatrixOrthoLH
(
&
gotmat
,
2
.
5
f
,
7
.
4
f
,
-
3
.
2
f
,
-
9
.
8
f
);
expect_mat
(
expectedmat
,
gotmat
);
/*____________D3DXMatrixOrthoOffCenterLH_______________*/
expectedmat
.
m
[
0
][
0
]
=
3
.
636364
f
;
expectedmat
.
m
[
0
][
1
]
=
0
.
0
f
;
expectedmat
.
m
[
0
][
2
]
=
0
.
0
f
;
expectedmat
.
m
[
0
][
3
]
=
0
.
0
f
;
expectedmat
.
m
[
1
][
0
]
=
0
.
0
f
;
expectedmat
.
m
[
1
][
1
]
=
0
.
180180
f
;
expectedmat
.
m
[
1
][
2
]
=
0
.
0
;
expectedmat
.
m
[
1
][
3
]
=
0
.
0
f
;
expectedmat
.
m
[
2
][
0
]
=
0
.
0
f
;
expectedmat
.
m
[
2
][
1
]
=
0
.
0
f
;
expectedmat
.
m
[
2
][
2
]
=
-
0
.
045662
f
;
expectedmat
.
m
[
2
][
3
]
=
0
.
0
f
;
expectedmat
.
m
[
3
][
0
]
=
-
1
.
727272
f
;
expectedmat
.
m
[
3
][
1
]
=
-
0
.
567568
f
;
expectedmat
.
m
[
3
][
2
]
=
0
.
424658
f
;
expectedmat
.
m
[
3
][
3
]
=
1
.
0
f
;
U
(
expectedmat
).
m
[
0
][
0
]
=
3
.
636364
f
;
U
(
expectedmat
).
m
[
0
][
1
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
0
][
2
]
=
0
.
0
f
;
U
(
expectedmat
)
.
m
[
0
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
1
][
0
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
1
][
1
]
=
0
.
180180
f
;
U
(
expectedmat
).
m
[
1
][
2
]
=
0
.
0
;
U
(
expectedmat
)
.
m
[
1
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
2
][
0
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
2
][
1
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
2
][
2
]
=
-
0
.
045662
f
;
U
(
expectedmat
)
.
m
[
2
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
3
][
0
]
=
-
1
.
727272
f
;
U
(
expectedmat
).
m
[
3
][
1
]
=
-
0
.
567568
f
;
U
(
expectedmat
).
m
[
3
][
2
]
=
0
.
424658
f
;
U
(
expectedmat
)
.
m
[
3
][
3
]
=
1
.
0
f
;
D3DXMatrixOrthoOffCenterLH
(
&
gotmat
,
0
.
2
f
,
0
.
75
f
,
-
2
.
4
f
,
8
.
7
f
,
9
.
3
,
-
12
.
6
);
expect_mat
(
expectedmat
,
gotmat
);
/*____________D3DXMatrixOrthoOffCenterRH_______________*/
expectedmat
.
m
[
0
][
0
]
=
3
.
636364
f
;
expectedmat
.
m
[
0
][
1
]
=
0
.
0
f
;
expectedmat
.
m
[
0
][
2
]
=
0
.
0
f
;
expectedmat
.
m
[
0
][
3
]
=
0
.
0
f
;
expectedmat
.
m
[
1
][
0
]
=
0
.
0
f
;
expectedmat
.
m
[
1
][
1
]
=
0
.
180180
f
;
expectedmat
.
m
[
1
][
2
]
=
0
.
0
;
expectedmat
.
m
[
1
][
3
]
=
0
.
0
f
;
expectedmat
.
m
[
2
][
0
]
=
0
.
0
f
;
expectedmat
.
m
[
2
][
1
]
=
0
.
0
f
;
expectedmat
.
m
[
2
][
2
]
=
0
.
045662
f
;
expectedmat
.
m
[
2
][
3
]
=
0
.
0
f
;
expectedmat
.
m
[
3
][
0
]
=
-
1
.
727272
f
;
expectedmat
.
m
[
3
][
1
]
=
-
0
.
567568
f
;
expectedmat
.
m
[
3
][
2
]
=
0
.
424658
f
;
expectedmat
.
m
[
3
][
3
]
=
1
.
0
f
;
U
(
expectedmat
).
m
[
0
][
0
]
=
3
.
636364
f
;
U
(
expectedmat
).
m
[
0
][
1
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
0
][
2
]
=
0
.
0
f
;
U
(
expectedmat
)
.
m
[
0
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
1
][
0
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
1
][
1
]
=
0
.
180180
f
;
U
(
expectedmat
).
m
[
1
][
2
]
=
0
.
0
;
U
(
expectedmat
)
.
m
[
1
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
2
][
0
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
2
][
1
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
2
][
2
]
=
0
.
045662
f
;
U
(
expectedmat
)
.
m
[
2
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
3
][
0
]
=
-
1
.
727272
f
;
U
(
expectedmat
).
m
[
3
][
1
]
=
-
0
.
567568
f
;
U
(
expectedmat
).
m
[
3
][
2
]
=
0
.
424658
f
;
U
(
expectedmat
)
.
m
[
3
][
3
]
=
1
.
0
f
;
D3DXMatrixOrthoOffCenterRH
(
&
gotmat
,
0
.
2
f
,
0
.
75
f
,
-
2
.
4
f
,
8
.
7
f
,
9
.
3
,
-
12
.
6
);
expect_mat
(
expectedmat
,
gotmat
);
/*____________D3DXMatrixOrthoRH_______________*/
expectedmat
.
m
[
0
][
0
]
=
0
.
8
f
;
expectedmat
.
m
[
0
][
1
]
=
0
.
0
f
;
expectedmat
.
m
[
0
][
2
]
=
0
.
0
f
;
expectedmat
.
m
[
0
][
3
]
=
0
.
0
f
;
expectedmat
.
m
[
1
][
0
]
=
0
.
0
f
;
expectedmat
.
m
[
1
][
1
]
=
0
.
270270
f
;
expectedmat
.
m
[
1
][
2
]
=
0
.
0
f
;
expectedmat
.
m
[
1
][
3
]
=
0
.
0
f
;
expectedmat
.
m
[
2
][
0
]
=
0
.
0
f
;
expectedmat
.
m
[
2
][
1
]
=
0
.
0
f
;
expectedmat
.
m
[
2
][
2
]
=
0
.
151515
f
;
expectedmat
.
m
[
2
][
3
]
=
0
.
0
f
;
expectedmat
.
m
[
3
][
0
]
=
0
.
0
f
;
expectedmat
.
m
[
3
][
1
]
=
0
.
0
f
;
expectedmat
.
m
[
3
][
2
]
=
-
0
.
484848
f
;
expectedmat
.
m
[
3
][
3
]
=
1
.
0
f
;
U
(
expectedmat
).
m
[
0
][
0
]
=
0
.
8
f
;
U
(
expectedmat
).
m
[
0
][
1
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
0
][
2
]
=
0
.
0
f
;
U
(
expectedmat
)
.
m
[
0
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
1
][
0
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
1
][
1
]
=
0
.
270270
f
;
U
(
expectedmat
).
m
[
1
][
2
]
=
0
.
0
f
;
U
(
expectedmat
)
.
m
[
1
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
2
][
0
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
2
][
1
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
2
][
2
]
=
0
.
151515
f
;
U
(
expectedmat
)
.
m
[
2
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
3
][
0
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
3
][
1
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
3
][
2
]
=
-
0
.
484848
f
;
U
(
expectedmat
)
.
m
[
3
][
3
]
=
1
.
0
f
;
D3DXMatrixOrthoRH
(
&
gotmat
,
2
.
5
f
,
7
.
4
f
,
-
3
.
2
f
,
-
9
.
8
f
);
expect_mat
(
expectedmat
,
gotmat
);
/*____________D3DXMatrixPerspectiveFovLH_______________*/
expectedmat
.
m
[
0
][
0
]
=
13
.
288858
f
;
expectedmat
.
m
[
0
][
1
]
=
0
.
0
f
;
expectedmat
.
m
[
0
][
2
]
=
0
.
0
f
;
expectedmat
.
m
[
0
][
3
]
=
0
.
0
f
;
expectedmat
.
m
[
1
][
0
]
=
0
.
0
f
;
expectedmat
.
m
[
1
][
1
]
=
9
.
966644
f
;
expectedmat
.
m
[
1
][
2
]
=
0
.
0
;
expectedmat
.
m
[
1
][
3
]
=
0
.
0
f
;
expectedmat
.
m
[
2
][
0
]
=
0
.
0
f
;
expectedmat
.
m
[
2
][
1
]
=
0
.
0
f
;
expectedmat
.
m
[
2
][
2
]
=
0
.
783784
f
;
expectedmat
.
m
[
2
][
3
]
=
1
.
0
f
;
expectedmat
.
m
[
3
][
0
]
=
0
.
0
f
;
expectedmat
.
m
[
3
][
1
]
=
0
.
0
f
;
expectedmat
.
m
[
3
][
2
]
=
1
.
881081
f
;
expectedmat
.
m
[
3
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
0
][
0
]
=
13
.
288858
f
;
U
(
expectedmat
).
m
[
0
][
1
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
0
][
2
]
=
0
.
0
f
;
U
(
expectedmat
)
.
m
[
0
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
1
][
0
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
1
][
1
]
=
9
.
966644
f
;
U
(
expectedmat
).
m
[
1
][
2
]
=
0
.
0
;
U
(
expectedmat
)
.
m
[
1
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
2
][
0
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
2
][
1
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
2
][
2
]
=
0
.
783784
f
;
U
(
expectedmat
)
.
m
[
2
][
3
]
=
1
.
0
f
;
U
(
expectedmat
).
m
[
3
][
0
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
3
][
1
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
3
][
2
]
=
1
.
881081
f
;
U
(
expectedmat
)
.
m
[
3
][
3
]
=
0
.
0
f
;
D3DXMatrixPerspectiveFovLH
(
&
gotmat
,
0
.
2
f
,
0
.
75
f
,
-
2
.
4
f
,
8
.
7
f
);
expect_mat
(
expectedmat
,
gotmat
);
/*____________D3DXMatrixPerspectiveFovRH_______________*/
expectedmat
.
m
[
0
][
0
]
=
13
.
288858
f
;
expectedmat
.
m
[
0
][
1
]
=
0
.
0
f
;
expectedmat
.
m
[
0
][
2
]
=
0
.
0
f
;
expectedmat
.
m
[
0
][
3
]
=
0
.
0
f
;
expectedmat
.
m
[
1
][
0
]
=
0
.
0
f
;
expectedmat
.
m
[
1
][
1
]
=
9
.
966644
f
;
expectedmat
.
m
[
1
][
2
]
=
0
.
0
;
expectedmat
.
m
[
1
][
3
]
=
0
.
0
f
;
expectedmat
.
m
[
2
][
0
]
=
0
.
0
f
;
expectedmat
.
m
[
2
][
1
]
=
0
.
0
f
;
expectedmat
.
m
[
2
][
2
]
=
-
0
.
783784
f
;
expectedmat
.
m
[
2
][
3
]
=
-
1
.
0
f
;
expectedmat
.
m
[
3
][
0
]
=
0
.
0
f
;
expectedmat
.
m
[
3
][
1
]
=
0
.
0
f
;
expectedmat
.
m
[
3
][
2
]
=
1
.
881081
f
;
expectedmat
.
m
[
3
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
0
][
0
]
=
13
.
288858
f
;
U
(
expectedmat
).
m
[
0
][
1
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
0
][
2
]
=
0
.
0
f
;
U
(
expectedmat
)
.
m
[
0
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
1
][
0
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
1
][
1
]
=
9
.
966644
f
;
U
(
expectedmat
).
m
[
1
][
2
]
=
0
.
0
;
U
(
expectedmat
)
.
m
[
1
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
2
][
0
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
2
][
1
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
2
][
2
]
=
-
0
.
783784
f
;
U
(
expectedmat
)
.
m
[
2
][
3
]
=
-
1
.
0
f
;
U
(
expectedmat
).
m
[
3
][
0
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
3
][
1
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
3
][
2
]
=
1
.
881081
f
;
U
(
expectedmat
)
.
m
[
3
][
3
]
=
0
.
0
f
;
D3DXMatrixPerspectiveFovRH
(
&
gotmat
,
0
.
2
f
,
0
.
75
f
,
-
2
.
4
f
,
8
.
7
f
);
expect_mat
(
expectedmat
,
gotmat
);
/*____________D3DXMatrixPerspectiveLH_______________*/
expectedmat
.
m
[
0
][
0
]
=
-
24
.
0
f
;
expectedmat
.
m
[
0
][
1
]
=
0
.
0
f
;
expectedmat
.
m
[
0
][
2
]
=
0
.
0
f
;
expectedmat
.
m
[
0
][
3
]
=
0
.
0
f
;
expectedmat
.
m
[
1
][
0
]
=
0
.
0
f
;
expectedmat
.
m
[
1
][
1
]
=
-
6
.
4
f
;
expectedmat
.
m
[
1
][
2
]
=
0
.
0
;
expectedmat
.
m
[
1
][
3
]
=
0
.
0
f
;
expectedmat
.
m
[
2
][
0
]
=
0
.
0
f
;
expectedmat
.
m
[
2
][
1
]
=
0
.
0
f
;
expectedmat
.
m
[
2
][
2
]
=
0
.
783784
f
;
expectedmat
.
m
[
2
][
3
]
=
1
.
0
f
;
expectedmat
.
m
[
3
][
0
]
=
0
.
0
f
;
expectedmat
.
m
[
3
][
1
]
=
0
.
0
f
;
expectedmat
.
m
[
3
][
2
]
=
1
.
881081
f
;
expectedmat
.
m
[
3
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
0
][
0
]
=
-
24
.
0
f
;
U
(
expectedmat
).
m
[
0
][
1
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
0
][
2
]
=
0
.
0
f
;
U
(
expectedmat
)
.
m
[
0
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
1
][
0
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
1
][
1
]
=
-
6
.
4
f
;
U
(
expectedmat
).
m
[
1
][
2
]
=
0
.
0
;
U
(
expectedmat
)
.
m
[
1
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
2
][
0
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
2
][
1
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
2
][
2
]
=
0
.
783784
f
;
U
(
expectedmat
)
.
m
[
2
][
3
]
=
1
.
0
f
;
U
(
expectedmat
).
m
[
3
][
0
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
3
][
1
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
3
][
2
]
=
1
.
881081
f
;
U
(
expectedmat
)
.
m
[
3
][
3
]
=
0
.
0
f
;
D3DXMatrixPerspectiveLH
(
&
gotmat
,
0
.
2
f
,
0
.
75
f
,
-
2
.
4
f
,
8
.
7
f
);
expect_mat
(
expectedmat
,
gotmat
);
/*____________D3DXMatrixPerspectiveOffCenterLH_______________*/
expectedmat
.
m
[
0
][
0
]
=
11
.
636364
f
;
expectedmat
.
m
[
0
][
1
]
=
0
.
0
f
;
expectedmat
.
m
[
0
][
2
]
=
0
.
0
f
;
expectedmat
.
m
[
0
][
3
]
=
0
.
0
f
;
expectedmat
.
m
[
1
][
0
]
=
0
.
0
f
;
expectedmat
.
m
[
1
][
1
]
=
0
.
576577
f
;
expectedmat
.
m
[
1
][
2
]
=
0
.
0
;
expectedmat
.
m
[
1
][
3
]
=
0
.
0
f
;
expectedmat
.
m
[
2
][
0
]
=
-
1
.
727273
f
;
expectedmat
.
m
[
2
][
1
]
=
-
0
.
567568
f
;
expectedmat
.
m
[
2
][
2
]
=
0
.
840796
f
;
expectedmat
.
m
[
2
][
3
]
=
1
.
0
f
;
expectedmat
.
m
[
3
][
0
]
=
0
.
0
f
;
expectedmat
.
m
[
3
][
1
]
=
0
.
0
f
;
expectedmat
.
m
[
3
][
2
]
=
-
2
.
690547
f
;
expectedmat
.
m
[
3
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
0
][
0
]
=
11
.
636364
f
;
U
(
expectedmat
).
m
[
0
][
1
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
0
][
2
]
=
0
.
0
f
;
U
(
expectedmat
)
.
m
[
0
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
1
][
0
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
1
][
1
]
=
0
.
576577
f
;
U
(
expectedmat
).
m
[
1
][
2
]
=
0
.
0
;
U
(
expectedmat
)
.
m
[
1
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
2
][
0
]
=
-
1
.
727273
f
;
U
(
expectedmat
).
m
[
2
][
1
]
=
-
0
.
567568
f
;
U
(
expectedmat
).
m
[
2
][
2
]
=
0
.
840796
f
;
U
(
expectedmat
)
.
m
[
2
][
3
]
=
1
.
0
f
;
U
(
expectedmat
).
m
[
3
][
0
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
3
][
1
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
3
][
2
]
=
-
2
.
690547
f
;
U
(
expectedmat
)
.
m
[
3
][
3
]
=
0
.
0
f
;
D3DXMatrixPerspectiveOffCenterLH
(
&
gotmat
,
0
.
2
f
,
0
.
75
f
,
-
2
.
4
f
,
8
.
7
f
,
3
.
2
f
,
-
16
.
9
f
);
expect_mat
(
expectedmat
,
gotmat
);
/*____________D3DXMatrixPerspectiveOffCenterRH_______________*/
expectedmat
.
m
[
0
][
0
]
=
11
.
636364
f
;
expectedmat
.
m
[
0
][
1
]
=
0
.
0
f
;
expectedmat
.
m
[
0
][
2
]
=
0
.
0
f
;
expectedmat
.
m
[
0
][
3
]
=
0
.
0
f
;
expectedmat
.
m
[
1
][
0
]
=
0
.
0
f
;
expectedmat
.
m
[
1
][
1
]
=
0
.
576577
f
;
expectedmat
.
m
[
1
][
2
]
=
0
.
0
;
expectedmat
.
m
[
1
][
3
]
=
0
.
0
f
;
expectedmat
.
m
[
2
][
0
]
=
1
.
727273
f
;
expectedmat
.
m
[
2
][
1
]
=
0
.
567568
f
;
expectedmat
.
m
[
2
][
2
]
=
-
0
.
840796
f
;
expectedmat
.
m
[
2
][
3
]
=
-
1
.
0
f
;
expectedmat
.
m
[
3
][
0
]
=
0
.
0
f
;
expectedmat
.
m
[
3
][
1
]
=
0
.
0
f
;
expectedmat
.
m
[
3
][
2
]
=
-
2
.
690547
f
;
expectedmat
.
m
[
3
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
0
][
0
]
=
11
.
636364
f
;
U
(
expectedmat
).
m
[
0
][
1
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
0
][
2
]
=
0
.
0
f
;
U
(
expectedmat
)
.
m
[
0
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
1
][
0
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
1
][
1
]
=
0
.
576577
f
;
U
(
expectedmat
).
m
[
1
][
2
]
=
0
.
0
;
U
(
expectedmat
)
.
m
[
1
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
2
][
0
]
=
1
.
727273
f
;
U
(
expectedmat
).
m
[
2
][
1
]
=
0
.
567568
f
;
U
(
expectedmat
).
m
[
2
][
2
]
=
-
0
.
840796
f
;
U
(
expectedmat
)
.
m
[
2
][
3
]
=
-
1
.
0
f
;
U
(
expectedmat
).
m
[
3
][
0
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
3
][
1
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
3
][
2
]
=
-
2
.
690547
f
;
U
(
expectedmat
)
.
m
[
3
][
3
]
=
0
.
0
f
;
D3DXMatrixPerspectiveOffCenterRH
(
&
gotmat
,
0
.
2
f
,
0
.
75
f
,
-
2
.
4
f
,
8
.
7
f
,
3
.
2
f
,
-
16
.
9
f
);
expect_mat
(
expectedmat
,
gotmat
);
/*____________D3DXMatrixPerspectiveRH_______________*/
expectedmat
.
m
[
0
][
0
]
=
-
24
.
0
f
;
expectedmat
.
m
[
0
][
1
]
=
-
0
.
0
f
;
expectedmat
.
m
[
0
][
2
]
=
0
.
0
f
;
expectedmat
.
m
[
0
][
3
]
=
0
.
0
f
;
expectedmat
.
m
[
1
][
0
]
=
0
.
0
f
;
expectedmat
.
m
[
1
][
1
]
=
-
6
.
4
f
;
expectedmat
.
m
[
1
][
2
]
=
0
.
0
;
expectedmat
.
m
[
1
][
3
]
=
0
.
0
f
;
expectedmat
.
m
[
2
][
0
]
=
0
.
0
f
;
expectedmat
.
m
[
2
][
1
]
=
0
.
0
f
;
expectedmat
.
m
[
2
][
2
]
=
-
0
.
783784
f
;
expectedmat
.
m
[
2
][
3
]
=
-
1
.
0
f
;
expectedmat
.
m
[
3
][
0
]
=
0
.
0
f
;
expectedmat
.
m
[
3
][
1
]
=
0
.
0
f
;
expectedmat
.
m
[
3
][
2
]
=
1
.
881081
f
;
expectedmat
.
m
[
3
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
0
][
0
]
=
-
24
.
0
f
;
U
(
expectedmat
).
m
[
0
][
1
]
=
-
0
.
0
f
;
U
(
expectedmat
).
m
[
0
][
2
]
=
0
.
0
f
;
U
(
expectedmat
)
.
m
[
0
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
1
][
0
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
1
][
1
]
=
-
6
.
4
f
;
U
(
expectedmat
).
m
[
1
][
2
]
=
0
.
0
;
U
(
expectedmat
)
.
m
[
1
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
2
][
0
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
2
][
1
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
2
][
2
]
=
-
0
.
783784
f
;
U
(
expectedmat
)
.
m
[
2
][
3
]
=
-
1
.
0
f
;
U
(
expectedmat
).
m
[
3
][
0
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
3
][
1
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
3
][
2
]
=
1
.
881081
f
;
U
(
expectedmat
)
.
m
[
3
][
3
]
=
0
.
0
f
;
D3DXMatrixPerspectiveRH
(
&
gotmat
,
0
.
2
f
,
0
.
75
f
,
-
2
.
4
f
,
8
.
7
f
);
expect_mat
(
expectedmat
,
gotmat
);
/*____________D3DXMatrixRotationAxis_____*/
expectedmat
.
m
[
0
][
0
]
=
0
.
508475
f
;
expectedmat
.
m
[
0
][
1
]
=
0
.
763805
f
;
expectedmat
.
m
[
0
][
2
]
=
0
.
397563
f
;
expectedmat
.
m
[
0
][
3
]
=
0
.
0
f
;
expectedmat
.
m
[
1
][
0
]
=
-
0
.
814652
f
;
expectedmat
.
m
[
1
][
1
]
=
0
.
576271
f
;
expectedmat
.
m
[
1
][
2
]
=
-
0
.
06521
9
f
;
expectedmat
.
m
[
1
][
3
]
=
0
.
0
f
;
expectedmat
.
m
[
2
][
0
]
=
-
0
.
278919
f
;
expectedmat
.
m
[
2
][
1
]
=
-
0
.
290713
f
;
expectedmat
.
m
[
2
][
2
]
=
0
.
915254
f
;
expectedmat
.
m
[
2
][
3
]
=
0
.
0
f
;
expectedmat
.
m
[
3
][
0
]
=
0
.
0
f
;
expectedmat
.
m
[
3
][
1
]
=
0
.
0
f
;
expectedmat
.
m
[
3
][
2
]
=
0
.
0
f
;
expectedmat
.
m
[
3
][
3
]
=
1
.
0
f
;
U
(
expectedmat
).
m
[
0
][
0
]
=
0
.
508475
f
;
U
(
expectedmat
).
m
[
0
][
1
]
=
0
.
763805
f
;
U
(
expectedmat
).
m
[
0
][
2
]
=
0
.
397563
f
;
U
(
expectedmat
)
.
m
[
0
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
1
][
0
]
=
-
0
.
814652
f
;
U
(
expectedmat
).
m
[
1
][
1
]
=
0
.
576271
f
;
U
(
expectedmat
).
m
[
1
][
2
]
=
-
0
.
06521
9
f
;
U
(
expectedmat
)
.
m
[
1
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
2
][
0
]
=
-
0
.
278919
f
;
U
(
expectedmat
).
m
[
2
][
1
]
=
-
0
.
290713
f
;
U
(
expectedmat
).
m
[
2
][
2
]
=
0
.
915254
f
;
U
(
expectedmat
)
.
m
[
2
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
3
][
0
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
3
][
1
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
3
][
2
]
=
0
.
0
f
;
U
(
expectedmat
)
.
m
[
3
][
3
]
=
1
.
0
f
;
D3DXMatrixRotationAxis
(
&
gotmat
,
&
axis
,
angle
);
expect_mat
(
expectedmat
,
gotmat
);
/*____________D3DXMatrixRotationQuaternion______________*/
expectedmat
.
m
[
0
][
0
]
=
-
129
.
0
f
;
expectedmat
.
m
[
0
][
1
]
=
-
162
.
0
f
;
expectedmat
.
m
[
0
][
2
]
=
-
74
.
0
f
;
expectedmat
.
m
[
0
][
3
]
=
0
.
0
f
;
expectedmat
.
m
[
1
][
0
]
=
146
.
0
f
;
expectedmat
.
m
[
1
][
1
]
=
-
99
.
0
f
;
expectedmat
.
m
[
1
][
2
]
=
-
78
.
0
f
;
expectedmat
.
m
[
1
][
3
]
=
0
.
0
f
;
expectedmat
.
m
[
2
][
0
]
=
102
.
0
f
;
expectedmat
.
m
[
2
][
1
]
=
-
34
.
0
f
;
expectedmat
.
m
[
2
][
2
]
=
-
33
.
0
f
;
expectedmat
.
m
[
2
][
3
]
=
0
.
0
f
;
expectedmat
.
m
[
3
][
0
]
=
0
.
0
f
;
expectedmat
.
m
[
3
][
1
]
=
0
.
0
f
;
expectedmat
.
m
[
3
][
2
]
=
0
.
0
f
;
expectedmat
.
m
[
3
][
3
]
=
1
.
0
f
;
U
(
expectedmat
).
m
[
0
][
0
]
=
-
129
.
0
f
;
U
(
expectedmat
).
m
[
0
][
1
]
=
-
162
.
0
f
;
U
(
expectedmat
).
m
[
0
][
2
]
=
-
74
.
0
f
;
U
(
expectedmat
)
.
m
[
0
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
1
][
0
]
=
146
.
0
f
;
U
(
expectedmat
).
m
[
1
][
1
]
=
-
99
.
0
f
;
U
(
expectedmat
).
m
[
1
][
2
]
=
-
78
.
0
f
;
U
(
expectedmat
)
.
m
[
1
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
2
][
0
]
=
102
.
0
f
;
U
(
expectedmat
).
m
[
2
][
1
]
=
-
34
.
0
f
;
U
(
expectedmat
).
m
[
2
][
2
]
=
-
33
.
0
f
;
U
(
expectedmat
)
.
m
[
2
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
3
][
0
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
3
][
1
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
3
][
2
]
=
0
.
0
f
;
U
(
expectedmat
)
.
m
[
3
][
3
]
=
1
.
0
f
;
D3DXMatrixRotationQuaternion
(
&
gotmat
,
&
q
);
expect_mat
(
expectedmat
,
gotmat
);
/*____________D3DXMatrixRotationX______________*/
expectedmat
.
m
[
0
][
0
]
=
1
.
0
f
;
expectedmat
.
m
[
0
][
1
]
=
0
.
0
f
;
expectedmat
.
m
[
0
][
2
]
=
0
.
0
f
;
expectedmat
.
m
[
0
][
3
]
=
0
.
0
f
;
expectedmat
.
m
[
1
][
0
]
=
0
.
0
;
expectedmat
.
m
[
1
][
1
]
=
0
.
5
f
;
expectedmat
.
m
[
1
][
2
]
=
sqrt
(
3
.
0
f
)
/
2
.
0
f
;
expectedmat
.
m
[
1
][
3
]
=
0
.
0
f
;
expectedmat
.
m
[
2
][
0
]
=
0
.
0
f
;
expectedmat
.
m
[
2
][
1
]
=
-
sqrt
(
3
.
0
f
)
/
2
.
0
f
;
expectedmat
.
m
[
2
][
2
]
=
0
.
5
f
;
expectedmat
.
m
[
2
][
3
]
=
0
.
0
f
;
expectedmat
.
m
[
3
][
0
]
=
0
.
0
f
;
expectedmat
.
m
[
3
][
1
]
=
0
.
0
f
;
expectedmat
.
m
[
3
][
2
]
=
0
.
0
f
;
expectedmat
.
m
[
3
][
3
]
=
1
.
0
f
;
U
(
expectedmat
).
m
[
0
][
0
]
=
1
.
0
f
;
U
(
expectedmat
).
m
[
0
][
1
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
0
][
2
]
=
0
.
0
f
;
U
(
expectedmat
)
.
m
[
0
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
1
][
0
]
=
0
.
0
;
U
(
expectedmat
).
m
[
1
][
1
]
=
0
.
5
f
;
U
(
expectedmat
).
m
[
1
][
2
]
=
sqrt
(
3
.
0
f
)
/
2
.
0
f
;
U
(
expectedmat
)
.
m
[
1
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
2
][
0
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
2
][
1
]
=
-
sqrt
(
3
.
0
f
)
/
2
.
0
f
;
U
(
expectedmat
).
m
[
2
][
2
]
=
0
.
5
f
;
U
(
expectedmat
)
.
m
[
2
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
3
][
0
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
3
][
1
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
3
][
2
]
=
0
.
0
f
;
U
(
expectedmat
)
.
m
[
3
][
3
]
=
1
.
0
f
;
D3DXMatrixRotationX
(
&
gotmat
,
angle
);
expect_mat
(
expectedmat
,
gotmat
);
/*____________D3DXMatrixRotationY______________*/
expectedmat
.
m
[
0
][
0
]
=
0
.
5
f
;
expectedmat
.
m
[
0
][
1
]
=
0
.
0
f
;
expectedmat
.
m
[
0
][
2
]
=
-
sqrt
(
3
.
0
f
)
/
2
.
0
f
;
expectedmat
.
m
[
0
][
3
]
=
0
.
0
f
;
expectedmat
.
m
[
1
][
0
]
=
0
.
0
;
expectedmat
.
m
[
1
][
1
]
=
1
.
0
f
;
expectedmat
.
m
[
1
][
2
]
=
0
.
0
f
;
expectedmat
.
m
[
1
][
3
]
=
0
.
0
f
;
expectedmat
.
m
[
2
][
0
]
=
sqrt
(
3
.
0
f
)
/
2
.
0
f
;
expectedmat
.
m
[
2
][
1
]
=
0
.
0
f
;
expectedmat
.
m
[
2
][
2
]
=
0
.
5
f
;
expectedmat
.
m
[
2
][
3
]
=
0
.
0
f
;
expectedmat
.
m
[
3
][
0
]
=
0
.
0
f
;
expectedmat
.
m
[
3
][
1
]
=
0
.
0
f
;
expectedmat
.
m
[
3
][
2
]
=
0
.
0
f
;
expectedmat
.
m
[
3
][
3
]
=
1
.
0
f
;
U
(
expectedmat
).
m
[
0
][
0
]
=
0
.
5
f
;
U
(
expectedmat
).
m
[
0
][
1
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
0
][
2
]
=
-
sqrt
(
3
.
0
f
)
/
2
.
0
f
;
U
(
expectedmat
)
.
m
[
0
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
1
][
0
]
=
0
.
0
;
U
(
expectedmat
).
m
[
1
][
1
]
=
1
.
0
f
;
U
(
expectedmat
).
m
[
1
][
2
]
=
0
.
0
f
;
U
(
expectedmat
)
.
m
[
1
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
2
][
0
]
=
sqrt
(
3
.
0
f
)
/
2
.
0
f
;
U
(
expectedmat
).
m
[
2
][
1
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
2
][
2
]
=
0
.
5
f
;
U
(
expectedmat
)
.
m
[
2
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
3
][
0
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
3
][
1
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
3
][
2
]
=
0
.
0
f
;
U
(
expectedmat
)
.
m
[
3
][
3
]
=
1
.
0
f
;
D3DXMatrixRotationY
(
&
gotmat
,
angle
);
expect_mat
(
expectedmat
,
gotmat
);
/*____________D3DXMatrixRotationYawPitchRoll____*/
expectedmat
.
m
[
0
][
0
]
=
0
.
888777
f
;
expectedmat
.
m
[
0
][
1
]
=
0
.
091875
f
;
expectedmat
.
m
[
0
][
2
]
=
-
0
.
449037
f
;
expectedmat
.
m
[
0
][
3
]
=
0
.
0
f
;
expectedmat
.
m
[
1
][
0
]
=
0
.
351713
f
;
expectedmat
.
m
[
1
][
1
]
=
0
.
491487
f
;
expectedmat
.
m
[
1
][
2
]
=
0
.
796705
f
;
expectedmat
.
m
[
1
][
3
]
=
0
.
0
f
;
expectedmat
.
m
[
2
][
0
]
=
0
.
293893
f
;
expectedmat
.
m
[
2
][
1
]
=
-
0
.
866025
f
;
expectedmat
.
m
[
2
][
2
]
=
0
.
404509
f
;
expectedmat
.
m
[
2
][
3
]
=
0
.
0
f
;
expectedmat
.
m
[
3
][
0
]
=
0
.
0
f
;
expectedmat
.
m
[
3
][
1
]
=
0
.
0
f
;
expectedmat
.
m
[
3
][
2
]
=
0
.
0
f
;
expectedmat
.
m
[
3
][
3
]
=
1
.
0
f
;
U
(
expectedmat
).
m
[
0
][
0
]
=
0
.
888777
f
;
U
(
expectedmat
).
m
[
0
][
1
]
=
0
.
091875
f
;
U
(
expectedmat
).
m
[
0
][
2
]
=
-
0
.
449037
f
;
U
(
expectedmat
)
.
m
[
0
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
1
][
0
]
=
0
.
351713
f
;
U
(
expectedmat
).
m
[
1
][
1
]
=
0
.
491487
f
;
U
(
expectedmat
).
m
[
1
][
2
]
=
0
.
796705
f
;
U
(
expectedmat
)
.
m
[
1
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
2
][
0
]
=
0
.
293893
f
;
U
(
expectedmat
).
m
[
2
][
1
]
=
-
0
.
866025
f
;
U
(
expectedmat
).
m
[
2
][
2
]
=
0
.
404509
f
;
U
(
expectedmat
)
.
m
[
2
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
3
][
0
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
3
][
1
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
3
][
2
]
=
0
.
0
f
;
U
(
expectedmat
)
.
m
[
3
][
3
]
=
1
.
0
f
;
D3DXMatrixRotationYawPitchRoll
(
&
gotmat
,
3
.
0
f
*
angle
/
5
.
0
f
,
angle
,
3
.
0
f
*
angle
/
17
.
0
f
);
expect_mat
(
expectedmat
,
gotmat
);
/*____________D3DXMatrixRotationZ______________*/
expectedmat
.
m
[
0
][
0
]
=
0
.
5
f
;
expectedmat
.
m
[
0
][
1
]
=
sqrt
(
3
.
0
f
)
/
2
.
0
f
;
expectedmat
.
m
[
0
][
2
]
=
0
.
0
f
;
expectedmat
.
m
[
0
][
3
]
=
0
.
0
f
;
expectedmat
.
m
[
1
][
0
]
=
-
sqrt
(
3
.
0
f
)
/
2
.
0
f
;
expectedmat
.
m
[
1
][
1
]
=
0
.
5
f
;
expectedmat
.
m
[
1
][
2
]
=
0
.
0
f
;
expectedmat
.
m
[
1
][
3
]
=
0
.
0
f
;
expectedmat
.
m
[
2
][
0
]
=
0
.
0
f
;
expectedmat
.
m
[
2
][
1
]
=
0
.
0
f
;
expectedmat
.
m
[
2
][
2
]
=
1
.
0
f
;
expectedmat
.
m
[
2
][
3
]
=
0
.
0
f
;
expectedmat
.
m
[
3
][
0
]
=
0
.
0
f
;
expectedmat
.
m
[
3
][
1
]
=
0
.
0
f
;
expectedmat
.
m
[
3
][
2
]
=
0
.
0
f
;
expectedmat
.
m
[
3
][
3
]
=
1
.
0
f
;
U
(
expectedmat
).
m
[
0
][
0
]
=
0
.
5
f
;
U
(
expectedmat
).
m
[
0
][
1
]
=
sqrt
(
3
.
0
f
)
/
2
.
0
f
;
U
(
expectedmat
).
m
[
0
][
2
]
=
0
.
0
f
;
U
(
expectedmat
)
.
m
[
0
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
1
][
0
]
=
-
sqrt
(
3
.
0
f
)
/
2
.
0
f
;
U
(
expectedmat
).
m
[
1
][
1
]
=
0
.
5
f
;
U
(
expectedmat
).
m
[
1
][
2
]
=
0
.
0
f
;
U
(
expectedmat
)
.
m
[
1
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
2
][
0
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
2
][
1
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
2
][
2
]
=
1
.
0
f
;
U
(
expectedmat
)
.
m
[
2
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
3
][
0
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
3
][
1
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
3
][
2
]
=
0
.
0
f
;
U
(
expectedmat
)
.
m
[
3
][
3
]
=
1
.
0
f
;
D3DXMatrixRotationZ
(
&
gotmat
,
angle
);
expect_mat
(
expectedmat
,
gotmat
);
/*____________D3DXMatrixScaling______________*/
expectedmat
.
m
[
0
][
0
]
=
0
.
69
f
;
expectedmat
.
m
[
0
][
1
]
=
0
.
0
f
;
expectedmat
.
m
[
0
][
2
]
=
0
.
0
f
;
expectedmat
.
m
[
0
][
3
]
=
0
.
0
f
;
expectedmat
.
m
[
1
][
0
]
=
0
.
0
;
expectedmat
.
m
[
1
][
1
]
=
0
.
53
f
;
expectedmat
.
m
[
1
][
2
]
=
0
.
0
f
;
expectedmat
.
m
[
1
][
3
]
=
0
.
0
f
;
expectedmat
.
m
[
2
][
0
]
=
0
.
0
f
;
expectedmat
.
m
[
2
][
1
]
=
0
.
0
f
;
expectedmat
.
m
[
2
][
2
]
=
4
.
11
f
;
expectedmat
.
m
[
2
][
3
]
=
0
.
0
f
;
expectedmat
.
m
[
3
][
0
]
=
0
.
0
f
;
expectedmat
.
m
[
3
][
1
]
=
0
.
0
f
;
expectedmat
.
m
[
3
][
2
]
=
0
.
0
f
;
expectedmat
.
m
[
3
][
3
]
=
1
.
0
f
;
U
(
expectedmat
).
m
[
0
][
0
]
=
0
.
69
f
;
U
(
expectedmat
).
m
[
0
][
1
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
0
][
2
]
=
0
.
0
f
;
U
(
expectedmat
)
.
m
[
0
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
1
][
0
]
=
0
.
0
;
U
(
expectedmat
).
m
[
1
][
1
]
=
0
.
53
f
;
U
(
expectedmat
).
m
[
1
][
2
]
=
0
.
0
f
;
U
(
expectedmat
)
.
m
[
1
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
2
][
0
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
2
][
1
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
2
][
2
]
=
4
.
11
f
;
U
(
expectedmat
)
.
m
[
2
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
3
][
0
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
3
][
1
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
3
][
2
]
=
0
.
0
f
;
U
(
expectedmat
)
.
m
[
3
][
3
]
=
1
.
0
f
;
D3DXMatrixScaling
(
&
gotmat
,
0
.
69
f
,
0
.
53
f
,
4
.
11
f
);
expect_mat
(
expectedmat
,
gotmat
);
/*____________D3DXMatrixTranslation______________*/
expectedmat
.
m
[
0
][
0
]
=
1
.
0
f
;
expectedmat
.
m
[
0
][
1
]
=
0
.
0
f
;
expectedmat
.
m
[
0
][
2
]
=
0
.
0
f
;
expectedmat
.
m
[
0
][
3
]
=
0
.
0
f
;
expectedmat
.
m
[
1
][
0
]
=
0
.
0
;
expectedmat
.
m
[
1
][
1
]
=
1
.
0
f
;
expectedmat
.
m
[
1
][
2
]
=
0
.
0
f
;
expectedmat
.
m
[
1
][
3
]
=
0
.
0
f
;
expectedmat
.
m
[
2
][
0
]
=
0
.
0
f
;
expectedmat
.
m
[
2
][
1
]
=
0
.
0
f
;
expectedmat
.
m
[
2
][
2
]
=
1
.
0
f
;
expectedmat
.
m
[
2
][
3
]
=
0
.
0
f
;
expectedmat
.
m
[
3
][
0
]
=
0
.
69
f
;
expectedmat
.
m
[
3
][
1
]
=
0
.
53
f
;
expectedmat
.
m
[
3
][
2
]
=
4
.
11
f
;
expectedmat
.
m
[
3
][
3
]
=
1
.
0
f
;
U
(
expectedmat
).
m
[
0
][
0
]
=
1
.
0
f
;
U
(
expectedmat
).
m
[
0
][
1
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
0
][
2
]
=
0
.
0
f
;
U
(
expectedmat
)
.
m
[
0
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
1
][
0
]
=
0
.
0
;
U
(
expectedmat
).
m
[
1
][
1
]
=
1
.
0
f
;
U
(
expectedmat
).
m
[
1
][
2
]
=
0
.
0
f
;
U
(
expectedmat
)
.
m
[
1
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
2
][
0
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
2
][
1
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
2
][
2
]
=
1
.
0
f
;
U
(
expectedmat
)
.
m
[
2
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
3
][
0
]
=
0
.
69
f
;
U
(
expectedmat
).
m
[
3
][
1
]
=
0
.
53
f
;
U
(
expectedmat
).
m
[
3
][
2
]
=
4
.
11
f
;
U
(
expectedmat
)
.
m
[
3
][
3
]
=
1
.
0
f
;
D3DXMatrixTranslation
(
&
gotmat
,
0
.
69
f
,
0
.
53
f
,
4
.
11
f
);
expect_mat
(
expectedmat
,
gotmat
);
/*____________D3DXMatrixTranspose______________*/
expectedmat
.
m
[
0
][
0
]
=
10
.
0
f
;
expectedmat
.
m
[
0
][
1
]
=
11
.
0
f
;
expectedmat
.
m
[
0
][
2
]
=
19
.
0
f
;
expectedmat
.
m
[
0
][
3
]
=
2
.
0
f
;
expectedmat
.
m
[
1
][
0
]
=
5
.
0
;
expectedmat
.
m
[
1
][
1
]
=
20
.
0
f
;
expectedmat
.
m
[
1
][
2
]
=
-
21
.
0
f
;
expectedmat
.
m
[
1
][
3
]
=
3
.
0
f
;
expectedmat
.
m
[
2
][
0
]
=
7
.
0
f
;
expectedmat
.
m
[
2
][
1
]
=
16
.
0
f
;
expectedmat
.
m
[
2
][
2
]
=
30
.
f
;
expectedmat
.
m
[
2
][
3
]
=
-
4
.
0
f
;
expectedmat
.
m
[
3
][
0
]
=
8
.
0
f
;
expectedmat
.
m
[
3
][
1
]
=
33
.
0
f
;
expectedmat
.
m
[
3
][
2
]
=
43
.
0
f
;
expectedmat
.
m
[
3
][
3
]
=
-
40
.
0
f
;
U
(
expectedmat
).
m
[
0
][
0
]
=
10
.
0
f
;
U
(
expectedmat
).
m
[
0
][
1
]
=
11
.
0
f
;
U
(
expectedmat
).
m
[
0
][
2
]
=
19
.
0
f
;
U
(
expectedmat
)
.
m
[
0
][
3
]
=
2
.
0
f
;
U
(
expectedmat
).
m
[
1
][
0
]
=
5
.
0
;
U
(
expectedmat
).
m
[
1
][
1
]
=
20
.
0
f
;
U
(
expectedmat
).
m
[
1
][
2
]
=
-
21
.
0
f
;
U
(
expectedmat
)
.
m
[
1
][
3
]
=
3
.
0
f
;
U
(
expectedmat
).
m
[
2
][
0
]
=
7
.
0
f
;
U
(
expectedmat
).
m
[
2
][
1
]
=
16
.
0
f
;
U
(
expectedmat
).
m
[
2
][
2
]
=
30
.
f
;
U
(
expectedmat
)
.
m
[
2
][
3
]
=
-
4
.
0
f
;
U
(
expectedmat
).
m
[
3
][
0
]
=
8
.
0
f
;
U
(
expectedmat
).
m
[
3
][
1
]
=
33
.
0
f
;
U
(
expectedmat
).
m
[
3
][
2
]
=
43
.
0
f
;
U
(
expectedmat
)
.
m
[
3
][
3
]
=
-
40
.
0
f
;
D3DXMatrixTranspose
(
&
gotmat
,
&
mat
);
expect_mat
(
expectedmat
,
gotmat
);
}
...
...
@@ -514,10 +514,10 @@ static void D3X8Vector2Test(void)
w
.
x
=
4
.
0
f
;
w
.
y
=
-
3
.
0
f
;
x
.
x
=
2
.
0
f
;
x
.
y
=
-
11
.
0
f
;
mat
.
m
[
0
][
0
]
=
1
.
0
f
;
mat
.
m
[
0
][
1
]
=
2
.
0
f
;
mat
.
m
[
0
][
2
]
=
3
.
0
f
;
mat
.
m
[
0
][
3
]
=
4
.
0
f
;
mat
.
m
[
1
][
0
]
=
5
.
0
f
;
mat
.
m
[
1
][
1
]
=
6
.
0
f
;
mat
.
m
[
1
][
2
]
=
7
.
0
f
;
mat
.
m
[
1
][
3
]
=
8
.
0
f
;
mat
.
m
[
2
][
0
]
=
9
.
0
f
;
mat
.
m
[
2
][
1
]
=
10
.
0
f
;
mat
.
m
[
2
][
2
]
=
11
.
0
f
;
mat
.
m
[
2
][
3
]
=
12
.
0
f
;
mat
.
m
[
3
][
0
]
=
13
.
0
f
;
mat
.
m
[
3
][
1
]
=
14
.
0
f
;
mat
.
m
[
3
][
2
]
=
15
.
0
f
;
mat
.
m
[
3
][
3
]
=
16
.
0
f
;
U
(
mat
).
m
[
0
][
0
]
=
1
.
0
f
;
U
(
mat
).
m
[
0
][
1
]
=
2
.
0
f
;
U
(
mat
).
m
[
0
][
2
]
=
3
.
0
f
;
U
(
mat
)
.
m
[
0
][
3
]
=
4
.
0
f
;
U
(
mat
).
m
[
1
][
0
]
=
5
.
0
f
;
U
(
mat
).
m
[
1
][
1
]
=
6
.
0
f
;
U
(
mat
).
m
[
1
][
2
]
=
7
.
0
f
;
U
(
mat
)
.
m
[
1
][
3
]
=
8
.
0
f
;
U
(
mat
).
m
[
2
][
0
]
=
9
.
0
f
;
U
(
mat
).
m
[
2
][
1
]
=
10
.
0
f
;
U
(
mat
).
m
[
2
][
2
]
=
11
.
0
f
;
U
(
mat
)
.
m
[
2
][
3
]
=
12
.
0
f
;
U
(
mat
).
m
[
3
][
0
]
=
13
.
0
f
;
U
(
mat
).
m
[
3
][
1
]
=
14
.
0
f
;
U
(
mat
).
m
[
3
][
2
]
=
15
.
0
f
;
U
(
mat
)
.
m
[
3
][
3
]
=
16
.
0
f
;
coeff1
=
2
.
0
f
;
coeff2
=
5
.
0
f
;
scale
=
-
6
.
5
f
;
...
...
@@ -683,10 +683,10 @@ static void D3X8Vector3Test(void)
w
.
x
=
3
.
0
f
;
w
.
y
=
-
5
.
0
f
;
w
.
z
=
7
.
0
f
;
x
.
x
=
4
.
0
f
;
x
.
y
=
1
.
0
f
;
x
.
z
=
11
.
0
f
;
mat
.
m
[
0
][
0
]
=
1
.
0
f
;
mat
.
m
[
0
][
1
]
=
2
.
0
f
;
mat
.
m
[
0
][
2
]
=
3
.
0
f
;
mat
.
m
[
0
][
3
]
=
4
.
0
f
;
mat
.
m
[
1
][
0
]
=
5
.
0
f
;
mat
.
m
[
1
][
1
]
=
6
.
0
f
;
mat
.
m
[
1
][
2
]
=
7
.
0
f
;
mat
.
m
[
1
][
3
]
=
8
.
0
f
;
mat
.
m
[
2
][
0
]
=
9
.
0
f
;
mat
.
m
[
2
][
1
]
=
10
.
0
f
;
mat
.
m
[
2
][
2
]
=
11
.
0
f
;
mat
.
m
[
2
][
3
]
=
12
.
0
f
;
mat
.
m
[
3
][
0
]
=
13
.
0
f
;
mat
.
m
[
3
][
1
]
=
14
.
0
f
;
mat
.
m
[
3
][
2
]
=
15
.
0
f
;
mat
.
m
[
3
][
3
]
=
16
.
0
f
;
U
(
mat
).
m
[
0
][
0
]
=
1
.
0
f
;
U
(
mat
).
m
[
0
][
1
]
=
2
.
0
f
;
U
(
mat
).
m
[
0
][
2
]
=
3
.
0
f
;
U
(
mat
)
.
m
[
0
][
3
]
=
4
.
0
f
;
U
(
mat
).
m
[
1
][
0
]
=
5
.
0
f
;
U
(
mat
).
m
[
1
][
1
]
=
6
.
0
f
;
U
(
mat
).
m
[
1
][
2
]
=
7
.
0
f
;
U
(
mat
)
.
m
[
1
][
3
]
=
8
.
0
f
;
U
(
mat
).
m
[
2
][
0
]
=
9
.
0
f
;
U
(
mat
).
m
[
2
][
1
]
=
10
.
0
f
;
U
(
mat
).
m
[
2
][
2
]
=
11
.
0
f
;
U
(
mat
)
.
m
[
2
][
3
]
=
12
.
0
f
;
U
(
mat
).
m
[
3
][
0
]
=
13
.
0
f
;
U
(
mat
).
m
[
3
][
1
]
=
14
.
0
f
;
U
(
mat
).
m
[
3
][
2
]
=
15
.
0
f
;
U
(
mat
)
.
m
[
3
][
3
]
=
16
.
0
f
;
coeff1
=
2
.
0
f
;
coeff2
=
5
.
0
f
;
scale
=
-
6
.
5
f
;
...
...
@@ -851,10 +851,10 @@ static void D3X8Vector4Test(void)
w
.
x
=
4
.
0
f
;
w
.
y
=
6
.
0
f
;
w
.
z
=
-
2
.
0
f
;
w
.
w
=
1
.
0
f
;
x
.
x
=
6
.
0
f
;
x
.
y
=
-
7
.
0
f
;
x
.
z
=
8
.
0
f
;
x
.
w
=
-
9
.
0
f
;
mat
.
m
[
0
][
0
]
=
1
.
0
f
;
mat
.
m
[
0
][
1
]
=
2
.
0
f
;
mat
.
m
[
0
][
2
]
=
3
.
0
f
;
mat
.
m
[
0
][
3
]
=
4
.
0
f
;
mat
.
m
[
1
][
0
]
=
5
.
0
f
;
mat
.
m
[
1
][
1
]
=
6
.
0
f
;
mat
.
m
[
1
][
2
]
=
7
.
0
f
;
mat
.
m
[
1
][
3
]
=
8
.
0
f
;
mat
.
m
[
2
][
0
]
=
9
.
0
f
;
mat
.
m
[
2
][
1
]
=
10
.
0
f
;
mat
.
m
[
2
][
2
]
=
11
.
0
f
;
mat
.
m
[
2
][
3
]
=
12
.
0
f
;
mat
.
m
[
3
][
0
]
=
13
.
0
f
;
mat
.
m
[
3
][
1
]
=
14
.
0
f
;
mat
.
m
[
3
][
2
]
=
15
.
0
f
;
mat
.
m
[
3
][
3
]
=
16
.
0
f
;
U
(
mat
).
m
[
0
][
0
]
=
1
.
0
f
;
U
(
mat
).
m
[
0
][
1
]
=
2
.
0
f
;
U
(
mat
).
m
[
0
][
2
]
=
3
.
0
f
;
U
(
mat
)
.
m
[
0
][
3
]
=
4
.
0
f
;
U
(
mat
).
m
[
1
][
0
]
=
5
.
0
f
;
U
(
mat
).
m
[
1
][
1
]
=
6
.
0
f
;
U
(
mat
).
m
[
1
][
2
]
=
7
.
0
f
;
U
(
mat
)
.
m
[
1
][
3
]
=
8
.
0
f
;
U
(
mat
).
m
[
2
][
0
]
=
9
.
0
f
;
U
(
mat
).
m
[
2
][
1
]
=
10
.
0
f
;
U
(
mat
).
m
[
2
][
2
]
=
11
.
0
f
;
U
(
mat
)
.
m
[
2
][
3
]
=
12
.
0
f
;
U
(
mat
).
m
[
3
][
0
]
=
13
.
0
f
;
U
(
mat
).
m
[
3
][
1
]
=
14
.
0
f
;
U
(
mat
).
m
[
3
][
2
]
=
15
.
0
f
;
U
(
mat
)
.
m
[
3
][
3
]
=
16
.
0
f
;
coeff1
=
2
.
0
f
;
coeff2
=
5
.
0
;
scale
=
-
6
.
5
f
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment