Class DirectionalLight
A directional light.
Examples
// Create a directional light.
var origin = new Vector3(10, 10, 10);
var light = new DirectionalLight(Colors.White,
new Transform(origin, origin.Unitized()), 1.0);
var sunMaterial = new Material("Sun", Colors.Yellow, unlit: true);
// Create a model curve to visualize the light direction.
var dirCurve = new ModelCurve(new Line(light.Transform.Origin, light.Transform.Origin + light.Transform.ZAxis.Negate() * 10), sunMaterial);
var floor = new Floor(Polygon.Rectangle(20, 20), 0.1);
var column = new Column(new Vector3(5, 5), 5.0, null, Polygon.Rectangle(0.2, 0.2));
var mass = new Mass(Polygon.Rectangle(1, 1), 1.0, sunMaterial, new Transform(light.Transform.Origin));
Implements
System.ComponentModel.INotifyPropertyChanged
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Elements
Assembly: Hypar.Elements.dll
Syntax
public class DirectionalLight : Light, INotifyPropertyChanged
Constructors
DirectionalLight(Color, Transform, Double, Guid, String)
Create a directional light.
Declaration
public DirectionalLight(Color color, Transform transform, double intensity = 1, Guid id = default(Guid), string name = "Sun")
Parameters
Type | Name | Description |
---|---|---|
Color | color | The color of the light. |
Transform | transform | The light's transform. |
System.Double | intensity | The intensity of the light measured in lux. |
System.Guid | id | The unique identifier of the light. |
System.String | name | The name of the light. |
Implements
System.ComponentModel.INotifyPropertyChanged