Function Adds connection-dependent normals to a Field.
Syntax
#include <dx/dx.h> Field DXAddFaceNormal(Field f, int id, Vector v) Field DXAddFaceNormals(Field f, int start, int n, Vector *v).
Functional Details A Field may contain connection-dependent normals that can be used to flat-shade a polygonal object. If so, the normals component is expected to have the same size as the "connections" component, as indicated by its having a "dep" attribute of "connections." Both routines aid in constructing such a component.
DXAddFaceNormal | Adds one normal (v) to f with the specified zero-based id. If f does not contain a "normals" component, one is added. |
DXAddFaceNormals | Adds n normals (*v) to f. Identifiers begin with start. If f does not contain a "normals" component, one is added. |
Note: | Both routines are suitable for adding a small number of face normals and for rapid prototyping, but they are included here mainly for backward compatibility. For better performance, see DXAddArrayData and "Irregular Arrays". |
Normals are specified as Vectors and defined as follows:
typedef struct point { float x, y, z; } Point, Vector;
Note: | These routines do not check the "dep" attribute of the "normals" component. Thus, if a "normals" component that is "dep" on "positions" already exists in f, the routine adds one or more normals to the normals component, leaving the attribute unchanged. The result may be a component with the wrong number of items for "dep." |
Return Value Returns f or returns NULL and sets an error code.
See Also DXAddArrayData, DXAddPoint, ...Color, ...FrontColor, ...BackColor, ...Opacity, ...Normal,
[Data Explorer Home Page | Contact Data Explorer | Same document on Data Explorer Home Page ]