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
6c902b42
Commit
6c902b42
authored
Nov 11, 2007
by
David Adam
Committed by
Alexandre Julliard
Nov 12, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx8: Implement D3XMatrixVec3Project.
parent
3231c01c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
2 deletions
+39
-2
d3dx8.spec
dlls/d3dx8/d3dx8.spec
+1
-1
math.c
dlls/d3dx8/math.c
+14
-0
math.c
dlls/d3dx8/tests/math.c
+23
-1
d3dx8math.h
include/d3dx8math.h
+1
-0
No files found.
dlls/d3dx8/d3dx8.spec
View file @
6c902b42
...
...
@@ -12,7 +12,7 @@
@ stdcall D3DXVec3Transform(ptr ptr ptr)
@ stdcall D3DXVec3TransformCoord(ptr ptr ptr)
@ stdcall D3DXVec3TransformNormal(ptr ptr ptr)
@ st
ub D3DXVec3Project
@ st
dcall D3DXVec3Project(ptr ptr ptr ptr ptr ptr)
@ stub D3DXVec3Unproject
@ stdcall D3DXVec4Cross(ptr ptr ptr ptr)
@ stdcall D3DXVec4Normalize(ptr ptr)
...
...
dlls/d3dx8/math.c
View file @
6c902b42
...
...
@@ -553,6 +553,20 @@ D3DXVECTOR3* WINAPI D3DXVec3Normalize(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv)
return
pout
;
}
D3DXVECTOR3
*
WINAPI
D3DXVec3Project
(
D3DXVECTOR3
*
pout
,
CONST
D3DXVECTOR3
*
pv
,
CONST
D3DVIEWPORT8
*
pviewport
,
CONST
D3DXMATRIX
*
pprojection
,
CONST
D3DXMATRIX
*
pview
,
CONST
D3DXMATRIX
*
pworld
)
{
D3DXMATRIX
m1
,
m2
;
D3DXVECTOR3
vec
;
D3DXMatrixMultiply
(
&
m1
,
pworld
,
pview
);
D3DXMatrixMultiply
(
&
m2
,
&
m1
,
pprojection
);
D3DXVec3TransformCoord
(
&
vec
,
pv
,
&
m2
);
pout
->
x
=
pviewport
->
X
+
(
1
.
0
f
+
vec
.
x
)
*
pviewport
->
Width
/
2
.
0
f
;
pout
->
y
=
pviewport
->
Y
+
(
1
.
0
f
-
vec
.
y
)
*
pviewport
->
Height
/
2
.
0
f
;
pout
->
z
=
pviewport
->
MinZ
+
vec
.
z
*
(
pviewport
->
MaxZ
-
pviewport
->
MinZ
);
return
pout
;
}
D3DXVECTOR4
*
WINAPI
D3DXVec3Transform
(
D3DXVECTOR4
*
pout
,
CONST
D3DXVECTOR3
*
pv
,
CONST
D3DXMATRIX
*
pm
)
{
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
];
...
...
dlls/d3dx8/tests/math.c
View file @
6c902b42
...
...
@@ -692,10 +692,11 @@ static void D3X8Vector2Test(void)
static
void
D3X8Vector3Test
(
void
)
{
D3DVIEWPORT8
viewport
;
D3DXVECTOR3
expectedvec
,
gotvec
,
nul
,
nulproj
,
u
,
v
,
w
,
x
;
LPD3DXVECTOR3
funcpointer
;
D3DXVECTOR4
expectedtrans
,
gottrans
;
D3DXMATRIX
mat
;
D3DXMATRIX
mat
,
projection
,
view
,
world
;
FLOAT
coeff1
,
coeff2
,
expected
,
got
,
scale
;
nul
.
x
=
0
.
0
f
;
nul
.
y
=
0
.
0
f
;
nul
.
z
=
0
.
0
f
;
...
...
@@ -704,11 +705,26 @@ 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
;
viewport
.
Width
=
800
;
viewport
.
MinZ
=
0
.
2
f
;
viewport
.
X
=
10
;
viewport
.
Height
=
680
;
viewport
.
MaxZ
=
0
.
9
f
;
viewport
.
Y
=
5
;
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
;
view
.
m
[
0
][
1
]
=
5
.
0
f
;
view
.
m
[
0
][
2
]
=
7
.
0
f
;
view
.
m
[
0
][
3
]
=
8
.
0
f
;
view
.
m
[
1
][
0
]
=
11
.
0
f
;
view
.
m
[
1
][
2
]
=
16
.
0
f
;
view
.
m
[
1
][
3
]
=
33
.
0
f
;
view
.
m
[
2
][
0
]
=
19
.
0
f
;
view
.
m
[
2
][
1
]
=
-
21
.
0
f
;
view
.
m
[
2
][
3
]
=
43
.
0
f
;
view
.
m
[
3
][
0
]
=
2
.
0
f
;
view
.
m
[
3
][
1
]
=
3
.
0
f
;
view
.
m
[
3
][
2
]
=
-
4
.
0
f
;
view
.
m
[
0
][
0
]
=
10
.
0
f
;
view
.
m
[
1
][
1
]
=
20
.
0
f
;
view
.
m
[
2
][
2
]
=
30
.
0
f
;
view
.
m
[
3
][
3
]
=
-
40
.
0
f
;
world
.
m
[
0
][
0
]
=
21
.
0
f
;
world
.
m
[
0
][
1
]
=
2
.
0
f
;
world
.
m
[
0
][
2
]
=
3
.
0
f
;
world
.
m
[
0
][
3
]
=
4
.
0
;
world
.
m
[
1
][
0
]
=
5
.
0
f
;
world
.
m
[
1
][
1
]
=
23
.
0
f
;
world
.
m
[
1
][
2
]
=
7
.
0
f
;
world
.
m
[
1
][
3
]
=
8
.
0
f
;
world
.
m
[
2
][
0
]
=
-
8
.
0
f
;
world
.
m
[
2
][
1
]
=
-
7
.
0
f
;
world
.
m
[
2
][
2
]
=
25
.
0
f
;
world
.
m
[
2
][
3
]
=
-
5
.
0
f
;
world
.
m
[
3
][
0
]
=
-
4
.
0
f
;
world
.
m
[
3
][
1
]
=
-
3
.
0
f
;
world
.
m
[
3
][
2
]
=
-
2
.
0
f
;
world
.
m
[
3
][
3
]
=
27
.
0
f
;
coeff1
=
2
.
0
f
;
coeff2
=
5
.
0
f
;
scale
=
-
6
.
5
f
;
...
...
@@ -817,6 +833,12 @@ static void D3X8Vector3Test(void)
D3DXVec3Normalize
(
&
gotvec
,
&
nul
);
expect_vec3
(
expectedvec
,
gotvec
);
/*_______________D3DXVec3Project_________________________*/
expectedvec
.
x
=
1135
.
721924
f
;
expectedvec
.
y
=
147
.
086914
f
;
expectedvec
.
z
=
0
.
153412
f
;
D3DXMatrixPerspectiveFovLH
(
&
projection
,
D3DX_PI
/
4
.
0
f
,
20
.
0
f
/
17
.
0
f
,
1
.
0
f
,
1000
.
0
f
);
D3DXVec3Project
(
&
gotvec
,
&
u
,
&
viewport
,
&
projection
,
&
view
,
&
world
);
expect_vec3
(
expectedvec
,
gotvec
);
/*_______________D3DXVec3Scale____________________________*/
expectedvec
.
x
=
-
58
.
5
f
;
expectedvec
.
y
=
-
39
.
0
f
;
expectedvec
.
z
=
-
13
.
0
f
;
D3DXVec3Scale
(
&
gotvec
,
&
u
,
scale
);
...
...
include/d3dx8math.h
View file @
6c902b42
...
...
@@ -300,6 +300,7 @@ D3DXVECTOR3* WINAPI D3DXVec3BaryCentric(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv
D3DXVECTOR3
*
WINAPI
D3DXVec3CatmullRom
(
D3DXVECTOR3
*
pout
,
CONST
D3DXVECTOR3
*
pv0
,
CONST
D3DXVECTOR3
*
pv1
,
CONST
D3DXVECTOR3
*
pv2
,
CONST
D3DXVECTOR3
*
pv3
,
FLOAT
s
);
D3DXVECTOR3
*
WINAPI
D3DXVec3Hermite
(
D3DXVECTOR3
*
pout
,
CONST
D3DXVECTOR3
*
pv1
,
CONST
D3DXVECTOR3
*
pt1
,
CONST
D3DXVECTOR3
*
pv2
,
CONST
D3DXVECTOR3
*
pt2
,
FLOAT
s
);
D3DXVECTOR3
*
WINAPI
D3DXVec3Normalize
(
D3DXVECTOR3
*
pout
,
CONST
D3DXVECTOR3
*
pv
);
D3DXVECTOR3
*
WINAPI
D3DXVec3Project
(
D3DXVECTOR3
*
pout
,
CONST
D3DXVECTOR3
*
pv
,
CONST
D3DVIEWPORT8
*
pviewport
,
CONST
D3DXMATRIX
*
pprojection
,
CONST
D3DXMATRIX
*
pview
,
CONST
D3DXMATRIX
*
pworld
);
D3DXVECTOR4
*
WINAPI
D3DXVec3Transform
(
D3DXVECTOR4
*
pout
,
CONST
D3DXVECTOR3
*
pv
,
CONST
D3DXMATRIX
*
pm
);
D3DXVECTOR3
*
WINAPI
D3DXVec3TransformCoord
(
D3DXVECTOR3
*
pout
,
CONST
D3DXVECTOR3
*
pv
,
CONST
D3DXMATRIX
*
pm
);
D3DXVECTOR3
*
WINAPI
D3DXVec3TransformNormal
(
D3DXVECTOR3
*
pout
,
CONST
D3DXVECTOR3
*
pv
,
CONST
D3DXMATRIX
*
pm
);
...
...
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