|
![](/i/fill.gif) |
hello,
any body can help me to translate c function to poc sdl ?
here is the routine :
---------------------------------------------------------------------------
int no_interior( p1, p2, p3, v, vp, n, poly_or )
int p1, p2, p3; /* The vertices to consider */
vertex v[]; /* The vertex list */
int vp[]; /* The vertex pointers (which are left) */
int n; /* Number of vertices */
int poly_or; /* Polygon orientation */
{
int i; /* Iterative counter */
int p; /* The test point */
for (i = 0; i < n; i++) {
p = vp[i]; /* The point to test */
if ((p == p1) || (p == p2) || (p == p3))
continue; /* Don't bother checking against yourself */
if ( (determinant( p2, p1, p, v ) == poly_or)
|| (determinant( p1, p3, p, v ) == poly_or)
|| (determinant( p3, p2, p, v ) == poly_or) ) {
continue; /* This point is outside */
} else {
return 0; /* The point is inside */
}
}
return 1; /* No points inside this triangle */
}
---------------------------------------------------------------------------
v[] and vp[] exist and there declared as array].
i have to problems :
- 'continue' doesn't exist in pov (and is good)
- 'return val' too (and is good too).
ideas ?
greats thanks
Post a reply to this message
|
![](/i/fill.gif) |