Functions | |
HC_KEY | Insert_Distant_Light (double di, double dj, double dk) |
HC_KEY | DInsert_Distant_Light (double di, double dj, double dk) |
HC_KEY Insert_Distant_Light | ( | double | di, | |
double | dj, | |||
double | dk | |||
) |
Inserts a distant point source of light into your scene.
di | - Vector describing the direction in which the light lies, infinitely far away. | |
dj | - As above. | |
dk | - As above. |
In HOOPS Visualize, there are five possible sources of light. A scene's ambient light intensity is defined by Set_Color(). Individual distant (point) lights created by Insert_Distant_Light() . Individual local (point) lights created by Insert_Local_Light() . Individual directional local (point) lights created by Insert_Spot_Light() .
A distant light is similar to the sun: it's so far away that all the light rays arriving from it are parallel. The only important considerations are the light's color and direction - not its position. The direction specified by Insert_Distant_Light() can later be modified by the modelling transformations. The color is defined by the "lights" option of Set_Color() . Unlike local, spot, and area lights, distant lights illuminate all surfaces in a scene with equal intensity (the intensity defined by Set_Color() ).
The scope of a light is always its containing window. Even if the light is many levels down from the window in the segment tree, it still "shines light" on everything in the scene (except as noted below, under "light visibility"). In fact, if you want to have several lights of different colors, you must put them in different segments in order to set the different color attributes. You could also put a light in its own subsegment so as to make it orbit your scene using Rotate_Object().
The number of lights you can have in a scene is almost unlimited. Since the screen isn't able to keep getting brighter and brighter as additional lights are inserted, HOOPS Visualize scales the total brightness by the total brightness of all the light sources. Please see the "light scaling" Driver Option for a means of overriding this calculation.
The "fixed colors" driver option might also be of interest when using lights.
In the current implementation, lights only affect faces. Lines and edges are still drawn in the standard way, with static colors.
Turning off the visibility of a light makes that light cease to exist for the purpose of performing, a lighting calculation. This may be a convenient way to enter and leave "lighted" mode in your program.
Turning off the light visibility also prevents a light placed elsewhere in the segment tree (but within the same window) from shining through the local geometry. This could be useful for inserting geometries that don't need to be lit, such as annotations, into a lighted window.
Of the five types of possible light sources listed above, an ambient light is not sufficient to trigger lighting calculations. To force the system to perform lighting calculations, insert a black distant light.
HC_KEY DInsert_Distant_Light | ( | double | di, | |
double | dj, | |||
double | dk | |||
) |
Similar to Insert_Distant_Light(), but accepts parameters of type double for increased precision.
di | - Vector describing the direction in which the light lies, infinitely far away. | |
dj | - As above. | |
dk | - As above. |