EZ
Up Prev Next Contents


12.8 Specifying Geometric Objects

Geometric objects are specified by enclosing a series of vertices, normals and colors between EZ_Begin and EZ_End pair.

12.8.1 EZ_Begin and EZ_End

This pair of routines provides the only way to specify geometrical primitives.

void EZ_Begin(int PType); void EZ_End(void);

Possible primitive types are:

EZ_TRIANGLE_STRIP EZ_TRIANGLE_FAN EZ_TRIANGLES EZ_QUAD_STRIP EZ_QUADS EZ_POLYGON /* buggy */ EZ_LINE_STRIP EZ_LINES EZ_LINE_LOOP EZ_POINTS EZ_TMESH (rectangular triangular mesh, row majored) EZ_QMESH (rectangular quadrilateral mesh, row majored)

Warning: For the last two primitive types, one must call void EZ_SetTQMeshSize right after EZ_Begin. This function informs the graphical library about the size of the triangular or rectangular mesh being processed.

void EZ_SetTQMeshSize(int row, int col);

Warning: The only GL calls that are allowed inside an EZ_Begin and EZ_End pair are

12.8.2 A Brief Description of Geometrical Primitives

12.8.3 EZ_Vertex\{23\

EZ_Vertex23fv specifies the coordinates of a vertex and EZ_Normal3fv specifies the normal vector at a vertex. Arguments are either 2 floats or 3 floats or a pointer to 2 or 3 floats. The normal vector is used in lighting calculations. For example, the following sequence specifies a rectangle.

12.8.4 Pixmaps

EZ_Begin(EZ_QUADS); /* begin individual quads */ EZ_Normal3f(1.0, 0.0, 0.0); /* set the normal */ EZ_Vertex2f(0.0, 1.0); /* the first vertex */ EZ_Vertex2f(1.0, 1.0); EZ_Vertex2f(1.0, 0.0); EZ_Vertex2f(0.0, 1.0); EZ_End(); /* end the current object */

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Support for pixmaps has been added in release 1.38. To display a pixmap/bitmap on a 3DCanvas, one first call EZ_CreageGLImage to create an image from EZwgl pixmap (created by EZ_CreateLabelPixmapFrom***), then use EZ_PutGLImage*** to display the image in the current draw buffer. Relevent routines are the following.

EZ_GLImage *EZ_CreateGLImage(EZ_Pixmap *pix);
void EZ_GetGLImageWindow(int x, int y, int w, int h, EZ_GLImage **imgRet);
void EZ_GetGLImageXWindow(int x, int y, int w, int h, EZ_GLImage **imgRet);

void EZ_GetGLImageInfo(EZ_GLImage *glimage, Pixmap *pix_ret,
                       Pixmap *shape_ret, int w_ret, int h_ret);

void EZ_FreeGLImage(EZ_GLImage *glimage);

EZ_Pixmap *EZ_GetLabelPixmapFromGLImage(EZ_GLImage *image);

void EZ_PutGLImage(EZ_GLImage *glimage, 
                   int srcX, int srcY, int srcW, int srcH,
                    float destX, float destY, float destZ);
void EZ_PutGLImageScreen(EZ_GLImage *glimage,
                    int srcX, int srcY, int srcW, int srcH,
                    float destX, float destY, float destZ);
void EZ_PutGLImageWindow(EZ_GLImage *glimage,
                    int srcX, int srcY, int srcW, int srcH,
                    int destX, int destY);
void EZ_PutGLImageXWindow(EZ_GLImage *glimage,
                    int srcX, int srcY, int srcW, int srcH,
                    int destX, int destY);


Up Prev Next Contents

HTML Documentation Maintainance:Arturo Espinosa <arturo@nuclecu.unam.mx>