Defines | |
| #define | CLIP_DOTPROD(K, A, B, C, D) X(K)*A + Y(K)*B + Z(K)*C + W(K)*D |
| #define | POLY_CLIP(PLANE, A, B, C, D) |
| #define | LINE_CLIP(PLANE, A, B, C, D) |
Functions | |
| INLINE void | TAG (clip_line)(GLcontext *ctx |
Variables | |
| INLINE void GLuint | i |
| INLINE void GLuint GLuint | j |
|
|
|
|
|
Value: do { \
if (mask & PLANE) { \
GLfloat dpI = CLIP_DOTPROD( ii, A, B, C, D ); \
GLfloat dpJ = CLIP_DOTPROD( jj, A, B, C, D ); \
\
if (DIFFERENT_SIGNS(dpI, dpJ)) { \
GLuint newvert = VB->LastClipped++; \
VB->ClipMask[newvert] = 0; \
if (IS_NEGATIVE(dpJ)) { \
GLfloat t = dpI / (dpI - dpJ); \
VB->ClipMask[jj] |= PLANE; \
INTERP_4F( t, coord[newvert], coord[ii], coord[jj] ); \
interp( ctx, t, newvert, ii, jj, GL_FALSE ); \
jj = newvert; \
} else { \
GLfloat t = dpJ / (dpJ - dpI); \
VB->ClipMask[ii] |= PLANE; \
INTERP_4F( t, coord[newvert], coord[jj], coord[ii] ); \
interp( ctx, t, newvert, jj, ii, GL_FALSE ); \
ii = newvert; \
} \
} \
else if (IS_NEGATIVE(dpI)) \
return; \
} \
} while (0) |
|
|
|
|
|
|
|
|
|
|
|
|
1.2.13.1 written by Dimitri van Heesch,
© 1997-2001