POV-Ray : Newsgroups : povray.advanced-users : c -> sdl pov : c -> sdl pov Server Time
28 Jul 2024 22:19:13 EDT (-0400)
  c -> sdl pov  
From: Kurts
Date: 20 Sep 2003 05:54:24
Message: <kurtzlepirate-794460.11542420092003@netplex.aussie.org>
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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.