2 * $Source: x:/prj/tech/libsrc/r3d/RCS/xfrmclip.c $
5 * $Date: 1996/10/29 12:44:59 $
7 * Transform and projection definitions for clipping space
17 extern void r3_clipspace_code_points(int, r3s_point
*); // HACK HACK HACK
19 // go through and transform all the points.
20 // note that this also works for projection space, and
21 // unscaled space, but not linear, I think.
22 void r3_rotate_block_clip(int n
, r3s_point
*dst
, mxs_vector
*src
)
26 TEST_IN_BLOCK("r3_rotate_block_clip");
28 cur
= (uchar
*)(&(dst
->p
));
29 last
= cur
+ n
* r3d_glob
.cur_stride
;
32 mx_trans_mul_vec((mxs_vector
*)cur
, X2TRANS(&cx
.o2c
), src
++);
33 cur
+= r3d_glob
.cur_stride
;
36 if (r3d_clip_mode
== R3_CLIP
)
37 r3_clipspace_code_points(n
, dst
);
40 // This is only for clipped
41 void r3_project_block_clip(int n
, r3s_point
*p_list
)
45 TEST_IN_BLOCK("r3_project_block_clip");
47 cur
= (uchar
*)p_list
;
48 last
= cur
+ n
* r3d_glob
.cur_stride
;
51 r3s_point
*p
= (r3s_point
*)cur
;
54 cur
+= r3d_glob
.cur_stride
;
56 w
= 1.0/p
->p
.z
; // w is 1/z;
58 p
->grp
.sx
= (int)((p
->p
.x
* w
* r3d_glob
.x_prj
) + r3d_glob
.x_off
);
59 p
->grp
.sy
= (int)((p
->p
.y
* w
* r3d_glob
.y_prj
) + r3d_glob
.y_off
);
64 r3s_xform_tab r3d_xform_tab_clip
= {