Set_Normal

Functions

void Set_Normal (double x, double y, double z)
 Forces the normal vector at a vertex, edge, or face to a particular value. More...
 
void UnSet_Normal (void)
 Removes all settings established by a previous call to Set_Normal(). More...
 

Detailed Description

Function Documentation

◆ Set_Normal()

void Set_Normal ( double  x,
double  y,
double  z 
)

Forces the normal vector at a vertex, edge, or face to a particular value.

Parameters
x- A vector, in object-space coordinates, that defines the "out ward" direction from the face or vertex.
y-
z-

DETAILS

To do lighting HOOPS needs to know the direction of a vector perpendicular to the lighted surface. It is usually easy to calculate good face normals, but to do "interpolated lighting" from the vertices (see Set_Rendering_Options() ), vertex normals are needed, and these are harder to come by.

By default, the system will calculate vertex and edge normals as the average of the surrounding face normals. Your program, though, may have more accurate values for vertex or edge normals, especially if the shell or mesh is only an approximation of the true surface. Set_Normal() lets you override or prevent the HOOPS default calculation and give an explicit value. UnSet_Normal() restores the original HOOPS behavior.

Set_Normal() can also be used to override shell and mesh face normals, to make them more accurate. It does not work with plain polygon ( Insert_Polygon() ) faces or vertices.

Set_Normal() is only meaningful within the scope of an Open_Vertex() or Open_Face() - the "normal" attribute is unusual in that it cannot be set on a segment. There is no "QSet" form. But MSet_Vertex_Normals() ("Multi-Set") is offered as a convenient way to rapidly set a large number of vertex normal vectors.

The current "polygon handedness" defines the outward-facing side of the surface for purposes of the "backplane cull" Heuristic—the Set_Normal() vector is used for lighting purposes only.

NOTE: Show_Normal() will retrieve (after normalization) the value you loaded. Show_Net_Normal() will retrieve either your value or, if there is none, the value HOOPS has calculated. If the vertex or face is part of a closed shell, the calculated value will indicate the "outward" direction, otherwise it will have no particular orientation.

NOTES

RESTRICTIONS

See also
Insert_Mesh, Insert_Shell, Open_Geometry, Open_Face, Open_Vertex, Set_Heuristics, Set_Rendering_Options, MSet_Vertex_Normals.

◆ UnSet_Normal()

void UnSet_Normal ( void  )

Removes all settings established by a previous call to Set_Normal().

DETAILS

No additional details. See Set_Normal()