Supported Browsers Home   
MGL_availablePages Previous   
MGL_beginDirectAccess Next   
External Functions Up   

MGL_backfacing

Determines if a polygon is backfacing.

Declaration

int MGLAPI MGL_backfacing(
    fix32_t dx1,
    fix32_t dy1,
    fix32_t dx2,
    fix32_t dy2)

Prototype In

mgraph.h

Parameters

dx1

change in x along first edge

dy1

change in y along first edge

dx2

change in x along second edge

dy2

change in y along second edge

 

Return Value

1 if the polygon if backfacing, 0 if it is frontfacing

Description

Determine whether a polygon is backfacing given two fixed point vectors.  The vectors need to be derived from two consecutive counterclockwise edges of the polygon in order for this function to return accurate results.

Note that this function is written to correctly calculate the results for screen space coordinates, which can cause overflow with a normal 16.16 fixed point multiply if this is calculated directly using calls to MGL_FixMul.

Copyright © 2002 SciTech Software, Inc. Visit our web site at http://www.scitechsoft.com