|
zeLight
Use .new("light") to create the object. An enabled light will
affect all objects after it in the tree of a scene structure unless the
node containing the light saves and restores OpenGL attributes of its
predecessor.
:set(table)
table - a Lua table.
Sets light properties. Valid key-value paris are listed in the table.
Key |
Value |
Type |
Remark |
ambient |
{r, g, b, a} |
Numbers (0 to 1) in table |
Setw the ambient color of the light in red, green, blue ,and alpha. |
diffuse |
{r, g, b, a} |
Numbers (0 to 1)in table |
Setw the diffuse color of the light in red, green, blue ,and alpha. |
specular |
{r, g, b, a} |
Numbers (0 to 1) in table |
Setw the specular color of the light in red, green, blue ,and alpha. |
attenuation |
{constant, linear, quadratic} |
Numbers in table |
Specifies the constant, linear, and quadratic attenuation parameters
of light. |
local |
flag |
Boolean |
If true, sets the light as local; otherwise as directional (default). |
lightmodel |
flag |
Boolean |
If true, uses ligh model; otherwise, use material color (default). |
eye |
flag |
Boolean |
If true, sets the GL_LIGHT_MODEL_LOCAL_VIEWER parameter to 1; otherwise
to zero. |
twoside |
flag |
Boolean |
Sets the GL_LIGHT_MODEL_TWO_SIDE parameter to 1; otherwise to 0. |
spotdirection |
{x, y, z} |
Numbers in table |
Sets spot light direction. |
spotexponent |
value |
Number |
Sets the intensity distribution of the spot light. |
spotcutoff |
value |
Number |
Sets the cutoff angle (GL_SPOT_CUTOFF) of the spot light. |
enable |
flag |
Boolean |
Enable (default) and disable the object |
position |
{x, y, z} |
Numbers in table |
Sets the light postion. |
|