<br><br><div class="gmail_quote">2011/3/31 Matteo Bruni <span dir="ltr"><<a href="mailto:matteo.mystral@gmail.com">matteo.mystral@gmail.com</a>></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 <<a href="mailto:david.adam.cnrs@gmail.com">david.adam.cnrs@gmail.com</a>>:<br>
><br>
> + /* Check the width */<br>
> + v1 = *((D3DXVECTOR3*)(data+19*num_bytes_per_vertex));<br>
> + v2 = *((D3DXVECTOR3*)(data+18*num_bytes_per_vertex));<br>
> + length = D3DXVec3Length(D3DXVec3Subtract(&v2,&v1,&v2));<br>
> + ok(fabs(length-10.0f)<admitted_error, "Width expected= 10.0, received %f\n", 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'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 < num_vertices; i++)<br>
{<br>
float *vertex_data = data + i * num_bytes_per_vertex;<br>
if (vertex_data[0] < xmin) xmin = vertex_data[0];<br>
if (vertex_data[0] > xmax) xmax = vertex_data[0];<br>
if (vertex_data[1] < ymin) ymin = vertex_data[1];<br>
if (vertex_data[1] > ymax) ymax = vertex_data[1];<br>
if (vertex_data[2] < zmin) zmin = vertex_data[2];<br>
if (vertex_data[2] > 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>