Functions | |
void | Set_Color_By_Value (const char *types, const char *colorspace, double a, double b, double c) |
void Set_Color_By_Value | ( | const char * | types, |
const char * | colorspace, | ||
double | a, | ||
double | b, | ||
double | c | ||
) |
Changes the color to be used when rendering the contents of a segment. The color is defined numerically rather than by quoted-string.
types | - A list of which types of geometry are to be affected by this color specification. note that the constant is a quoted string. See below for description. |
colorspace | - Special constant—either "HLS", "HSV", "HIC", or "RGB". Note that the constant is a quoted string. Upper case versus lowercase is not significant. |
a | - The location in the selected color space (see below for details). |
b | - |
c | - |
There is a choice of methods of passing color information to the system: by string description and by numeric value. Much of the time a string description of the color you want ("red", or "light blue", for example) is the most straightforward way to go, and so that's the default method.
But some of the time (when testing lighting or shading models, for example) your program will actually be computing your colors, and formatting these numbers into the proper string syntax can be a nuisance. For these occasions, the "by value" routines are provided to let you pass the floating-point values directly, without having to convert them to strings. The "set color by value" routines have the same meaning as the regular "set color" routines except for the difference in argument-passing.
The types used can include the following:
------------------------------------------------------------------------------------ edges The straight lines connecting the vertices of a polygon, shell, or mesh, or the border of an ellipse or circle. faces The interior filled areas of polygons, shells, meshes, ellipses, and circles. back Possible only when a polygon handedness is given and backplane culls are turned off, applies to the backplane of any face. markers Applies to marker symbols. polylines Applies to lines, polylines, and inked lines. lines Synonymous with "polylines". text Applies to text strings. geometry Shorthand for faces, edges, markers, polylines, and text all at once. windows Used for window backgrounds. window contrast Used when window backgrounds require a contrasting color, either for drawing window frames or for drawing window patterns. face contrast Used when a contrasting color is required for drawing pat terned faces. lights Used for any light sources within its scope. Does not affect the color of a light located elsewhere in the segment tree but shining into this part of the tree. The "lightness" of the color controls the brightness of the light. lighting A synonym for "lights". ambient If there are no light sources in a given scene, the "ambient" light color is ignored. If there is at least one light, HOOPS will do a full lighting calculation and the "ambient" color will define a diffuse background lighting coming from all directions. You would usually use a combination of specific light sources plus ambient light. Ambient light applies to all geometry within its scope in the segment tree. It is usually specified at the window level. ambient light A synonym for "ambient". polygon contrast A synonym for "face contrast". "Face contrast" is preferred. polygons Shorthand for both faces and edges. ------------------------------------------------------------------------------------
Lowercase versus uppercase is not significant. Leading and trailing blanks do not matter. The trailing "s" on "edges", "faces", "windows", etc., can be omitted. More than one color type can be specified at a time; you should separate the names with commas within the quoted string.
Color space can be any of the following:
-------------------------------------------------------------------------------------- "HLS"--- For hue, lightness, and saturation (a "double cone", with black and white at the tips). "HSV"--- For hue, lightness, and value (a "single cone" standing on its point, with black at the tip and white at the center of the base). "HIC"--- For hue, intensity, and chromaticity (a cylinder, with black and white at the two ends). "RGB"--- For red, green, and blue (a cube, with white, black, and six primary colors at the corners). --------------------------------------------------------------------------------------
All values must be in the range of zero to one inclusive, except for hues, which range from zero to 360 degrees. If a hue is outside this range, the system will normalize the value.
Use UnSet_Color() or UnSet_One_Color() (see Set_Color() ) to remove a color-by-value.
MSet_Vertex_Colors_By_Value() ("Multi-Set") is offered as a convenience function to rapidly set a large number of vertex color values.
If you are making a false-color image using shell or mesh vertex colors, with one degree of freedom in the colors, you might get a more accurate picture if you use a color map and Set_Color_By_FIndex() rather than using Set_Color_By_Value() .