| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
3.1.2 Lighting
There are several functions for setup lighting. The general function is Light(bool) which switch on/off the lighting for overall plot. It influence only for graphics which created after Light() call (with one exception, mglGraphGL). 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.
- Method on
mglGraph(C++, Python):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.
- Method on
mglGraph(C++, Python):voidLight (intn,boolenable) - C function:
voidmgl_set_light_n (HMGLgr,intn,intenable) Switch on/off n-th light source separately.
- Method on
mglGraph(C++, Python):voidAddLight (intn,floatx,floaty,floatz,charc='w') - Method on
mglGraph(C++):voidLight (intn,mglPointp,charc='w',floatbright=0.5,boolinfty=true) - Method on
mglGraph(C++):voidLight (intn,mglPointp,mglColorc,floatbright=0.5,boolinfty=true) - C function:
voidmgl_add_light (HMGLgr,intn,floatx,floaty,floatz,charc) The function adds a light source with identification n at position p with color c and with brightness bright (which must be in range [0,1]). Flag infty=
trueputs the source to infinite distance (for the faster drawing).
- Method on
mglGraph(C++, Python):voidAmbient (floatbright=0.5) - C function:
voidmgl_set_ambbr (HMGLgr,floatbright) Sets the brightness of ambient light. The value should be in range [0,1].
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
