本文整理汇总了C#中Scene.AddLightSource方法的典型用法代码示例。如果您正苦于以下问题:C# Scene.AddLightSource方法的具体用法?C# Scene.AddLightSource怎么用?C# Scene.AddLightSource使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Scene
的用法示例。
在下文中一共展示了Scene.AddLightSource方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Render_Ball_on_plane
public void Render_Ball_on_plane()
{
var s = new Scene();
var mirror = new Material { Diffuse = new RealColor(Color.White), ReflectionCoefficient = 1.0 };
var matt = new Material { Diffuse = new RealColor(Color.Red), ReflectionCoefficient = 0 };
s.AddObject(new Sphere(100, 320, 300, 0, matt));
s.AddLightSource(new PointLight(new RealColor(1, 1, 1), 0, 240, -100));
s.AddLightSource(new PointLight(new RealColor(0.6f, 0.6f, 0.6f), 640, 240, -10000));
RenderSceneToFile(s);
}
示例2: Render_test_scene
public void Render_test_scene()
{
var s = new Scene();
var m1 = new Material { Diffuse = new RealColor(Color.Yellow), ReflectionCoefficient = 0.5 };
var m2 = new Material { Diffuse = new RealColor(Color.Cyan), ReflectionCoefficient = 0.5 };
var m3 = new Material { Diffuse = new RealColor(Color.Magenta), ReflectionCoefficient = 0.5 };
s.AddObject(new Sphere(100, 233, 290, 0, m1));
s.AddObject(new Sphere(100, 407, 290, 0, m2));
s.AddObject(new Sphere(100, 320, 140, 0, m3));
s.AddObject(new Sphere(30, 160, 240, -50, m3));
s.AddLightSource(new PointLight(new RealColor(1, 1, 1), 0, 240, -100));
s.AddLightSource(new PointLight(new RealColor(0.6f, 0.6f, 0.6f), 640, 240, -10000));
RenderSceneToFile(s);
}