Click or drag to resize
AB4D logo

LightingRigVisual3D Class

LightingRigVisual3D is a ModelVisual3D that contains 3 DirectionalLight and one AmbientLight objects that define the standard lighting with key, fill and back light.
Inheritance Hierarchy

Namespace: Ab3d.Visuals
Assembly: Ab3d.PowerToys (in Ab3d.PowerToys.dll) Version: 11.1.8864.1045
Syntax
C#
public class LightingRigVisual3D : ModelVisual3D

The LightingRigVisual3D type exposes the following members.

Constructors
 NameDescription
Public methodLightingRigVisual3D Constructor
Public methodLightingRigVisual3D(String) Constructor
Top
Properties
 NameDescription
Public propertyAmbientLightColor Gets or sets the color of the ambient light (default value is White with 8% brightness). Ambient light illuminates the scene from all directions.
Public propertyBackLightColor Gets or sets the color of the back light (default value is White with 35% brightness). Back light is a DirectionalLight that is directed in the opposite direction as the key light.
Public propertyFillLightColor Gets or sets the color of the fill light (default value is White with 60% brightness). Fill light is a DirectionalLight that is angled at 90 degrees to the key light.
Public propertyKeyLightColor Gets or sets the color of the key light (default value is White with 92% brightness).
Public propertyKeyLightDirection Gets or sets the length of the axis lines
Top
Methods
 NameDescription
Public methodStatic memberGetColorFromBrightness Returns a color that is defined by brightness - a percentage of used White color. 1 means full White, 0.5 means half white (R = 128, G = 128, B = 128)-
Protected methodStatic memberOnColorPropertyChanged OnKeyLightDirectionPropertyChanged
Protected methodStatic memberOnKeyLightDirectionPropertyChanged OnKeyLightDirectionPropertyChanged
Public methodSetKeyLightDirection Sets the key light direction with using simple heading and attitude values (in degrees).
Protected methodStatic memberValidateKeyLightDirectionPropertyValue Returns true if value is valid direction for key light.
Top
Fields
 NameDescription
Protected fieldambientLight Ambient light illuminates the scene from all directions.
Public fieldStatic memberAmbientLightColorProperty AmbientLightColorProperty
Protected fieldbackLight Back light is a DirectionalLight that is directed in the opposite direction as the key light.
Public fieldStatic memberBackLightColorProperty BackLightColorProperty
Protected fieldfillLight Fill light is a DirectionalLight that is angled at 90 degrees to the key light.
Public fieldStatic memberFillLightColorProperty FillLightColorProperty
Protected fieldkeyLight Key light is a DirectionalLight that directly illuminates the scene.
Public fieldStatic memberKeyLightColorProperty KeyLightColorProperty
Public fieldStatic memberKeyLightDirectionProperty KeyLightDirectionProperty
Top
Extension Methods
 NameDescription
Public Extension MethodDumpHierarchy Display details about the hierarchy of Visual3D children to Debug console (for example to Visual Studio's Immediate window).
(Defined by Extensions)
Public Extension MethodForEachGeometryModel3D Performs the specified action on each GeometryModel3D inside the rootModelVisual3D.
(Defined by Extensions)
Public Extension MethodForEachVisual3D Performs the specified action on each ModelVisual3D inside the rootModelVisual3D.
(Defined by Extensions)
Public Extension MethodGetName Gets name of the Visual3D that was previously set by SetName extension method.
(Defined by Extensions)
Public Extension MethodSetName Sets Name property to Visual3D. Note that if name is not correct for WPF, it can be corrected (name must start with a letter or the underscore character (_), and must contain only letters, digits, or underscores). In this case the SetName method will set the corrected name to the object and return false (in this case you can call GetName to get the corrected name). True is returned when the original name is set to the object.
(Defined by Extensions)
Top
Remarks

LightingRigVisual3D is a ModelVisual3D that contains 3 DirectionalLight and one AmbientLight objects that define the standard lighting with key, fill and back light.

The key light is the brightest, and provides the main illumination and shadows. This will typically be positioned to match a real light source such as an overhead lamp, a window, or the sun for an outdoor scene.

The fill light is dimmer, and usually angled at 90 degrees to the key. This is used to soften the shadows, adding shading and definition to areas that would otherwise be solid black.

The back light is positioned behind the character, facing toward the camera. This illuminates only the silhouette edges, helping the character stand out against the background.

The Ambient light adds an slight ambient lighting that illuminates the objects from all directions.

With KeyLightDirection it is possible to change the direction of the key light. This also changes the direction of other lights accordingly.

It is also possible to change the color of each of the light. To make changing color easier, it is possible to use GetColorFromBrightness(Double) method and create a light color only from a brightness percentage value.

See Also