Light Sample
Overview
Source code for Patch sample is available in Samples\VB
folder of the installation directory. Patch is an application, implemented in Visual Basic 6.0 which
displays Light.mdg model. It demonstrates programmatic manipulation of
properties of lighting.
Implementation
All the work is done inside Light. form code Form_Load() Sub retrieves IArray2 interface, controlling the array of all lights in the model.
The IArray2 is obtained via IArray
as "LightSourceArray" property from IPropertyArray,
which in turn is queried from IModel interface. The IArray pointer is kept in
m_iArrLights
member of the form.
The ILightSource interface m_iLightSource, implemented by the current light
source is retrieved in UpdateSourceInfo Sub
New lights are added or removed in SetLightSourceCount(int nCount) Sub using methods of IArray.
See also ILightSource,
Visual Basic Samples,
All samples.
|