| [ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
4.2.2 Lighting
There are several functions for setup lighting. The general function is light which switch on/off the lighting for overall plot. It influence only for graphics which created after light call (with one exception, OpenGL). Generally MathGL support up to 10 independent light sources. But in OpenGL mode only 8 of light sources is used due to OpenGL limitations. The position, color, brightness of each light source can be set separately. By default only one light source is active. It is source number 0 with white color, located at top of the plot.
- MGL command: light
[val=on] - Method on
mglGraph:boolLight (boolenable) - C function:
voidmgl_set_light (HMGLgr,intenable) Sets the using of light on/off for overall plot. Function returns previous value of lighting. Default value is lightning off.
- MGL command: light
numval - Method on
mglGraph:voidLight (intn,boolenable) - C function:
voidmgl_set_light_n (HMGLgr,intn,intenable) Switch on/off n-th light source separately.
- MGL command: light
num xdir ydir zdir['col'='w'br=0.5] - MGL command: light
num xdir ydir zdir xpos ypos zpos['col'='w'br=0.5] - Method on
mglGraph:voidAddLight (intn,mglPointd,charc='w',mrealbright=0.5,mrealap=0) - Method on
mglGraph:voidAddLight (intn,mglPointr,mglPointd,charc='w',mrealbright=0.5,mrealap=0) - C function:
voidmgl_add_light (HMGLgr,intn,mrealdx,mrealdy,mrealdz) - C function:
voidmgl_add_light_ext (HMGLgr,intn,mrealdx,mrealdy,mrealdz,charc,mrealbright,mrealap) - C function:
voidmgl_add_light_loc (HMGLgr,intn,mrealrx,mrealry,mrealrz,mrealdx,mrealdy,mrealdz,charc,mrealbright,mrealap) The function adds a light source with identification n in direction d with color c and with brightness bright (which must be in range [0,1]). If position r is specified and isn’t NAN then light source is supposed to be local otherwise light source is supposed to be placed at infinity.
- MGL command: diffuse
val - Method on
mglGraph:voidSetDiffuse (mrealbright) - C function:
voidmgl_set_difbr (HMGLgr,mrealbright) Set brightness of diffusive light (only for local light sources).
- MGL command: ambient
val - Method on
mglGraph:voidSetAmbient (mrealbright=0.5) - C function:
voidmgl_set_ambbr (HMGLgr,mrealbright) Sets the brightness of ambient light. The value should be in range [0,1].
| [ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated on March 21, 2014 using texi2html 5.0.
