POMPE@hlerul5.BITNET (Kees Pompe) (05/04/88)
Using SunCore to demonstrate a certain convergence in 3D I noted the zbuffer procedure. It seemed to me the ideal solution to make a nice picture without having to study the underlying algorithms. I have succeeded in plotting a number of 3D polygons, however, after closer examination, I don't understand how to use the zbuffer procedure (from C). Can anybody explain to me (in a clearer way than the manual does) how the parameters should be used, especially xlist and zlist? Are xlist and zlist input or output? Must xlist and zlist be initialized? I have included a description from the manual below. Please include some simple sort of example, if available. Please send responses directly to POMPE@HLERUL5.BITNET. Thanx. Kees Pompe ---------------------------------------------------------------------- Set Z Buffer Cut set_zbuffer_cut(surface_name, xlist, zlist, n) struct vwsurf *surface_name; float xlist [], zlist []; int n; set_zbuffer_cut specifies a cutaway view of 3D polygon objects when hidden surfaces are being removed. set_zbuffer_cut specifies an array of depths in NDC space. Any parts of objects which are closer to the viewer than this piecewise-linear function are clipped away. xlist is assumed to be monotonically increasing. This function specifies a piecewise-linear cutaway threshold in the z coordinate, which, given any x coordinate, is constant in y. The default cutaway depth is 0 for all values of x. Values of x less than xlist [0] or greater than xlist [n-1] will have the default depth. The view surface must have been initialized with the hidden flag on. ----------------------------------------------------------------------