1 // $Header: x:/prj/tech/libsrc/r3d/RCS/clipclip.c 1.9 1996/10/29 12:44:47 KEVIN Exp $
4 // off the right is y < -x
5 // off the left is y > x
6 // off the top is z > x
7 // off the bottom is z < -x
17 void r3_clipspace_code_points(int n
, r3s_point
*src
)
20 mxs_real nearxxx
= r3d_near_plane
;
22 TEST_IN_BLOCK("r3_clipspace_code_points");
25 last
= cur
+ n
* r3d_glob
.cur_stride
;
28 r3s_point
*p
= (r3s_point
*)cur
;
32 cur
+= r3d_glob
.cur_stride
;
34 if (p
->p
.x
> z
) code
= R3C_OFF_RIGHT
; else code
= R3C_NONE
;
35 if (p
->p
.x
< -z
) code
|= R3C_OFF_LEFT
;
37 if (p
->p
.y
< -z
) code
|= R3C_OFF_TOP
;
38 if (p
->p
.y
> z
) code
|= R3C_OFF_BOTTOM
;
40 if (z
< nearxxx
) code
|= R3C_BEHIND
;
46 r3_std_code_points(n
, src
);