fg_inside()

Win32 DirectX Fastgraph/Light

Prototype

int fg_inside (int *vertex_array, int n, int ix, int iy);

Function fg_inside (vertex_array() As Long, ByVal n As Long, ByVal ix As Long, ByVal iy As Long) As Long

function fg_inside (var vertex_array : integer; n, ix, iy : integer) : integer;

Description

The fg_inside() function determines if the specified point is inside a convex polygon. The fg_polyoff() offsets are applied to the polygon vertices but not to the test point.

Parameters

vertex_array is the name of the array containing the (x,y) coordinate pairs of each vertex. The first array element is the x component of the first vertex, the second element is the y component of the first vertex, the third element is the x component of the second vertex, and so forth.

n is the number of vertices in the polygon. Normally, it is one-half the size of vertex_array.

ix is the screen space x coordinate of the test point.

iy is the screen space y coordinate of the test point.

Return value

0 = The test point is outside the polygon

1 = The test point is inside the polygon

Restrictions

If vertex_array does not define a convex polygon, the return value is undefined.

See also

fg_polyedge(), fg_polyfill(), fg_polyline(), fg_polyoff()

Contents
Fastgraph Home Page

 

copyright 2001 Ted Gruber Software, Inc.