Main Page   Alphabetical List   Compound List   File List   Compound Members   File Members  

zbf.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Z-buffer display module

Date:
08-Nov-2005
Author:
Luiz F. Martha
Version:
1.0
--------------------------------------------------------------- Reference:

See class notes of courses CIV-2801 Fundamentos de Computacao Grafica Aplicada, Departamento de Engenharia Civil, PUC-Rio.

--------------------------------------------------------------- Description:

This header file contains public function specification and prototypes of the module to fill polygons in raster (image) coordinates using the z-buffer algorithm.

--------------------------------------------------------------- Revisions: Created: 08-Nov-2005 Luiz Fernando Martha Stolen from g3dcdrnd.c and and modified.

int zbfInit (int width, int height)
 This function initializes a zbuffer for displaying.

void zbfClose (void)
 This function closes a zbuffer.

void zbfBeginPoly (long int color)
 This function starts the display of a new polygon in this module.

void zbfVertex (double x, double y, double z)
 This function receives a vertex of the current polygon being displayed in this module.

void zbfEndPoly (void)
 This function finishes the specification of a polygon to be displayed in this module.


Function Documentation

void zbfBeginPoly long int    color
 

This function starts the display of a new polygon in this module.

The polygon is filled with the given color.

Parameters:
color  - coded color of polygon (in)

Definition at line 470 of file zbf.c.

References curr_color, npolyverts, and zbuff.

Referenced by dspZbfBeginPoly().

void zbfClose void   
 

This function closes a zbuffer.

It releases the memory used by the current allocated zbuffer.

Definition at line 461 of file zbf.c.

References cv_height, cv_width, and zbfRelease().

void zbfEndPoly void   
 

This function finishes the specification of a polygon to be displayed in this module.

It displays the polygon using the z-buffer algorithm.

Definition at line 502 of file zbf.c.

References npolyverts, NscPnt::x, NscPnt::y, NscPnt::z, and zbfFillPoly().

Referenced by dspZbfEndPoly().

int zbfInit int    width,
int    height
 

This function initializes a zbuffer for displaying.

It allocate memory for the zbuffer array and for local variables.

Parameters:
width, height  - sizes of new zbuffer (in)

Definition at line 445 of file zbf.c.

References cv_height, cv_width, zbfAlloc(), and zbuff.

Referenced by prjZbufferSnapShot().

void zbfVertex double    x,
double    y,
double    z
 

This function receives a vertex of the current polygon being displayed in this module.

It is assumed that the vertex is given in normalized screen coordinates (NSC). The view volume in NSC ranges from -1 to +1 in the three axes. In NSC, the front (near) clipping plane has z = -1 and the back (far) clipping plane has z = +1.

Parameters:
x, y, z  - polygon vertex in normalized screen coords. (in)

Definition at line 483 of file zbf.c.

References npolyverts, sizepoly, and zbuff.

Referenced by dspZbfVertex().


Generated on Tue Nov 8 10:58:10 2005 for Trab3 by doxygen1.2.18