Test the D3DXVec*Array functions

David Adam david.adam.cnrs at gmail.com
Fri Mar 21 03:40:14 CDT 2008


Hello,

+
+    /* D3DXVec3ProjectArray */
+    exp_vec[1].x = 1089.554199f; exp_vec[1].y = -226.590622f;
exp_vec[1].z = 0.215273f;
+    exp_vec[2].x = 1068.903320f; exp_vec[2].y =  103.085129f;
exp_vec[2].z = 0.183050f;
+    exp_vec[3].x = 1051.778931f; exp_vec[3].y =  376.462250f;
exp_vec[3].z = 0.156329f;
+    exp_vec[4].x = 1037.348877f; exp_vec[4].y =  606.827393f;
exp_vec[4].z = 0.133813f;
+    exp_vec[5].x = 1025.023560f; exp_vec[5].y =  803.591248f;
exp_vec[5].z = 0.114581f;
+    D3DXVec3ProjectArray((D3DXVECTOR3*)(out_vec + 1),
sizeof(D3DXVECTOR4), (CONST D3DXVECTOR3*)inp_vec, sizeof(D3DXVECTOR4),
&viewport, &projection, &view, &world, ARRAY_SIZE);
+    compare_index(exp_vec, out_vec, 0);
+    todo_wine {
+        /* D3DXVec3Project returns slightly ``wrong'' values here. */
+        compare_index(exp_vec, out_vec, 1);
+        compare_index(exp_vec, out_vec, 2);
+        compare_index(exp_vec, out_vec, 3);



Are all the relative errors <1%?
You are looking for an absolute error < 0.0001 for numbers >1000. It is too
much precision. One should check the relative error, that is
Re=(expected-got)/got
And we say that the test is ok if Re<0.01

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.winehq.org/pipermail/wine-patches/attachments/20080321/289a307f/attachment.htm 


More information about the wine-patches mailing list