<br><br><div class="gmail_quote">2011/3/31 Matteo Bruni <span dir="ltr">&lt;<a href="mailto:matteo.mystral@gmail.com">matteo.mystral@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
2011/3/31 David Adam &lt;<a href="mailto:david.adam.cnrs@gmail.com">david.adam.cnrs@gmail.com</a>&gt;:<br>
&gt;<br>
&gt; +      /* Check the width */<br>
&gt; +        v1 = *((D3DXVECTOR3*)(data+19*num_bytes_per_vertex));<br>
&gt; +        v2 = *((D3DXVECTOR3*)(data+18*num_bytes_per_vertex));<br>
&gt; +        length = D3DXVec3Length(D3DXVec3Subtract(&amp;v2,&amp;v1,&amp;v2));<br>
&gt; +        ok(fabs(length-10.0f)&lt;admitted_error, &quot;Width expected= 10.0, received %f\n&quot;, length);<br>
<br>
This is not really different from the previous version: you are still<br>
making assumptions about the vertex ordering (in this specific case,<br>
you&#39;re assuming that vertices 18 and 19 have different X coordinate<br>
but the same Y and Z coordinate values).<br></blockquote><div><br>I have an application (Geoprofs) qui use the specific ordering of the vertex. So if we implement randomly the vertex, it will not work. <br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

<br>
What I was proposing was something like this:<br>
<br>
for (i = 0; i &lt; num_vertices; i++)<br>
{<br>
    float *vertex_data = data + i * num_bytes_per_vertex;<br>
    if (vertex_data[0] &lt; xmin) xmin = vertex_data[0];<br>
    if (vertex_data[0] &gt; xmax) xmax = vertex_data[0];<br>
    if (vertex_data[1] &lt; ymin) ymin = vertex_data[1];<br>
    if (vertex_data[1] &gt; ymax) ymax = vertex_data[1];<br>
    if (vertex_data[2] &lt; zmin) zmin = vertex_data[2];<br>
    if (vertex_data[2] &gt; zmax) zmax = vertex_data[2];<br>
}<br>
<br>
and then proceed to check whether the minimum and maximum values you<br>
got match the expected ones. This code snippet can certainly be<br>
improved, it is only to show you what I meant.<br>
<br>
Also, again, please try to fix the whitespaces...<br>
</blockquote></div><br>People changed the original style of the file. So, Which one must I  keep ?<br><br>Thanks for your advices ;)<br><br>A+<br><br>David <br>