| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
3.1.1 Transparency
There are several functions and variables for setup transparency. The general function is Alpha() which switch on/off the transparency for overall plot. It influence only for graphics which created after Alpha() call (with one exception, mglGraphGL). Function SetAlphaDef specify the default value of alpha-channel. You may switch off transparency of selected plot by function SetTransparent. Finally, function SetTranspType set the kind of transparency. See section Transparent surface sample, for sample code and picture.
- Method on
mglGraph(C++, Python):boolAlpha (boolenable) - C function:
voidmgl_set_alpha (HMGLgr,intenable) Sets the transparency on/off and returns previous value of transparency. It is recommended to call this function before any plotting command. In any case it must be called before
Finish()function if the last is used. Default value is transparency off. Unfortunately it switches the transparency on/off for all subplots. UseSetTransparent(false)in particular plot to disable its transparency.
- Method on
mglGraph(C++, Python):voidSetAlphaDef (floatval) - C function:
voidmgl_set_alpha_default (HMGLgr,floatalpha) Sets default value of alpha channel (transparency) for all plotting functions. Note, that OpenGL (mglGraphGL) has incorrect drawing for large values of alpha in case of several overlapping surfaces.
- Method on
mglGraph(C++, Python):voidSetTransparent (boolval) - C function:
voidmgl_set_transp (HMGLgr,intenable) Flag which temporary switches transparency on/off for the plot. This is the same as
Alpha(val)but more correctly work in mglGraphGL class.
- Method on
mglGraph(C++, Python):voidSetTranspType (inttype) - C function:
voidmgl_set_transp_type (HMGLgr,intenable) Set the transparency type. Normal transparency (‘0’) – below things is less visible than upper ones. It does not look well in OpenGL mode (mglGraphGL) for several surfaces. Glass-like transparency (‘1’) – below and upper things are commutable and just decrease intensity of light by RGB channel. Lamp-like transparency (‘2’) – below and upper things are commutable and are the source of some additional light. I recommend to set
SetAlphaDef(0.3)or less for lamp-like transparency. See section Normal transparency, Glass-like transparency, Lamp-like transparency.
- Obsolete option of mglGraph:
boolTransparent Flag which temporary switches transparency on/off for the plot. See
SetTransparent().
- Obsolete option of mglGraph:
intTranspType This variable set the transparency type. See
SetTranspType().
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
