fg_gouraud()

Win32 DirectX Fastgraph/Light

Prototype

void fg_gouraud (int *vertex_array, char *rgb_array, int n);

Sub fg_gouraud (vertex_array() As Long, rgb_array() As Byte, ByVal n As Long)

procedure fg_gouraud (var vertex_array : integer; var rgb_array : byte; n : integer);

Description

The fg_gouraud() function draws a projected Gouraud-shaded convex polygon in screen space, with 2D clipping and automatic backface removal. This function is called internally by Fastgraph's 3D functions and is not usually called directly by applications.

Parameters

vertex_array is the name of the array containing the (x,y) coordinate pairs of each polygon vertex. The first array element is the x component of the first vertex, the second element is the y component of the first vertex, the third element is the x component of the second vertex, and so forth. The vertices must be stored in clockwise order, meaning you would travel clockwise along the polygon edge to go from one vertex to the next when facing the front of the polygon.

rgb_array is the name of the array containing the RGB color components for each (x,y) coordinate pair in vertex_array. The first three rgb_array elements represent the RGB color values at the first vertex in vertex_array, the next three rgb_array elements are for the second vertex, and so forth. Each RGB color component is a value between 0 and 255.

n is the number of vertices in each of the above arrays.

Return value

none

Restrictions

This function is meaningful only with direct color virtual buffers.

If you attempt to fill a non-convex polygon with fg_gouraud(), or if the vertices are not stored in clockwise order, only a portion of the polygon will be filled.

See also

fg_3Dshade(), fg_3Dshadeobject(), fg_gouraudz(), fg_inside(), fg_polyoff()

Contents
Fastgraph Home Page

 

copyright 2001 Ted Gruber Software, Inc.