当前位置: 首页>>代码示例>>C#>>正文


C# Plane.SetShadows方法代码示例

本文整理汇总了C#中Plane.SetShadows方法的典型用法代码示例。如果您正苦于以下问题:C# Plane.SetShadows方法的具体用法?C# Plane.SetShadows怎么用?C# Plane.SetShadows使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Plane的用法示例。


在下文中一共展示了Plane.SetShadows方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: build10

 void build10()
 {
     int ns = 49;
     world.ViewPlane.HRes = 400;
     world.ViewPlane.VRes = 400;
     world.ViewPlane.SetSampler(new Regular(ns));
     world.ViewPlane.MaxDepth = 10;
     world.Tracer = new Whitted(world);
     AmbientOccluder occ = new AmbientOccluder();
     occ.RadianceScale = 1.0f;
     occ.MinAmount = 0f;
     occ.Shadows = true;
     occ.Color = Vector3.One;
     occ.SetSampler(new MultiJittered(ns));
     world.AmbientLight = occ;
     Pinhole cam = new Pinhole();
     cam.Position = new Vector3(40, 30, 20);
     cam.Target = new Vector3(0, 0, 0);
     cam.Distance = 5500;
     cam.Zoom = 1.5f;
     world.Camera = cam;
     Sphere ss = new Sphere(new Vector3(2f, 0.5f, 1f), 0.5f, "MainPlane");
     ss.SetShadows(true);
     ss.SetMaterial(new Matte(0.25f, 0.5f, new Vector3(1f, 1f, 1f)) { Shadows = true });
     world.Objects.Add(ss);
     Matte matte = new Matte(0.25f, 0.5f, new Vector3(0.5f, 0, 0.5f));
     matte.Shadows = true;
     Box s = new Box(new Vector3(0, 0, 1), new Vector3(1, 1, 2), "Box1");
     s.SetShadows(true);
     s.SetMaterial(matte);
     world.Objects.Add(s);
     Matte m2 = new Matte(0.25f, 0, new Vector3(1, 1, 0));
     m2.Shadows = true;
     Box b2 = new Box(new Vector3(1, 1, 0), new Vector3(2, 2, 1), "Box2");
     b2.SetMaterial(m2);
     b2.SetShadows(true);
     //world.Objects.Add(b2);
     Matte matte2 = new Matte(0.75f, 0.5f, new Vector3(1, 1, 1));
     matte2.Shadows = true;
     Plane p = new Plane(Vector3.Zero, new Vector3(0, 1, 0), "Plane2");
     p.SetShadows(true);
     p.SetMaterial(matte2);
     world.Objects.Add(p);
     Matte m5 = new Matte(0.75f, 0.1f, new Vector3(0, 0.5f, 1));
     m5.Shadows = true;
     Annulus an = new Annulus(new Vector3(1, 1.2f, 0), Vector3.Up, 0.4f, 0.2f, "Annulus");
     an.SetMaterial(m5);
     an.SetShadows(true);
     world.Objects.Add(an);
     Matte m6 = new Matte(0.75f, 0.1f, new Vector3(1, 0, 0.4f));
     m6.Shadows = true;
     SolidCylinder sc = new SolidCylinder(0, 1, 0.5f, "Cs");
     sc.SetShadows(true);
     sc.SetMaterial(m6);
     world.Objects.Add(sc);
     PointLight pl = new PointLight();
     pl.Color = Vector3.One;
     pl.Position = new Vector3(4, 4, 0);
     pl.RadianceScale = 1.0f;
     pl.Shadows = true;
     world.Lights.Add(pl);
     float exp = 2000;
     Transparent sphere_material = new Transparent();
     sphere_material.SetSpecularRC(0.5f);
     sphere_material.SetExp(exp);
     sphere_material.SetIndexOfRefraction(1.5f);
     sphere_material.SetReflectiveRC(0.1f);
     sphere_material.SetTransmissionCoefficient(0.9f);
     Sphere sph = new Sphere(new Vector3(2f, 0.5f, 0f), 0.5f, "s1");
     sph.SetMaterial(sphere_material);
     world.Objects.Add(sph);
     Reflective smatte2 = new Reflective();
     smatte2.SetAmbientRC(0.25f);
     smatte2.SetDiffuseRC(0.5f);
     smatte2.SetRColor(new Vector3(1));
     smatte2.SetSpecularRC(0.15f);
     smatte2.SetExp(100);
     smatte2.SetReflectiveRC(0.75f);
     smatte2.SetCD(new Vector3(1));
     Sphere sphere = new Sphere(new Vector3(0, 2, 0), 0.4f, "s2");
     sphere.SetMaterial(smatte2);
     world.Objects.Add(sphere);
 }
开发者ID:JointJBA,项目名称:DisqueEngine,代码行数:83,代码来源:MainWindow.xaml.cs

示例2: build1

 void build1(int ns)
 {
     world.ViewPlane.HRes = 400;
     world.ViewPlane.VRes = 400;
     world.ViewPlane.MaxDepth = 5;
     world.ViewPlane.SetSamples(ns);
     world.Tracer = new Whitted(world);
     Ambient occ = new Ambient();
     occ.RadianceScale = 0f;
     occ.Shadows = true;
     occ.Color = Vector3.One;
     world.AmbientLight = occ;
     Pinhole cam = new Pinhole();
     cam.Position = new Vector3(0, 60, 120);
     cam.Distance = 100;
     cam.Zoom = 1400;
     world.Camera = cam;
     PointLight pl = new PointLight();
     pl.Color = Vector3.One;
     pl.Position = new Vector3(0, 1000, 0);
     pl.RadianceScale = 1.0f;
     pl.Shadows = true;
     world.Lights.Add(pl);
     OBJReader obj = new OBJReader(File.ReadAllText(@"C:\Users\Belal\Downloads\bunny.obj.txt"));
     Mesh mesh = obj.GetMesh();
     mesh.SetShadows(false);
     mesh.SetMaterial(Material.Glass);
     world.Objects.Add(mesh);
     BBox bb = mesh.GetBoundingBox();
     cam.Target = (bb.Min + bb.Max) * 0.5f;
     Matte matte2 = new Matte(0.5f, 0.5f, new Vector3(1, 1, 1));
     matte2.Shadows = true;
     Plane p = new Plane(new Vector3(0, -20, 0), new Vector3(0, 1, 0), "p1");
     p.SetShadows(true);
     p.SetMaterial(matte2);
     world.Objects.Add(p);
 }
开发者ID:JointJBA,项目名称:DisqueEngine,代码行数:37,代码来源:MainWindow.xaml.cs

示例3: build6

 void build6(int ns)
 {
     try
     {
         world.ViewPlane.HRes = 400;
         world.ViewPlane.VRes = 400;
         world.ViewPlane.MaxDepth = 5;
         world.ViewPlane.SetSamples(ns);
         world.Tracer = new Whitted(world);
         Ambient occ = new Ambient();
         occ.RadianceScale = 1.0f;
         //occ.MinAmount = 0f;
         occ.Shadows = true;
         occ.Color = Vector3.One;
         //occ.SetSampler(new MultiJittered(ns));
         world.AmbientLight = occ;
         Pinhole cam = new Pinhole();
         cam.Position = new Vector3(40, 30, 20);
         cam.Target = new Vector3(0, 0, 0);
         cam.Distance = 5000;
         cam.Zoom = 1;
         world.Camera = cam;
         Plastic plas = new Plastic();
         Vector3 color = new Vector3(1);
         float ls = 0.8f;
         plas.ambient = new Lambertian() { Color = color, ReflectionCoefficient = ls };
         plas.diffuse = new Lambertian() { Color = color, ReflectionCoefficient = ls };
         plas.specular = new GlossySpecular() { SpecularColor = color, ReflectionCoefficient = ls, Exponent = 500f };
         Sphere sp = new Sphere(new Vector3(0, 0.5f, 0), 0.5f, "sp");
         sp.SetMaterial(plas);
         world.Objects.Add(sp);
         Matte matte2 = new Matte(0.75f, 0.5f, new Vector3(1, 1, 1));
         matte2.Shadows = true;
         Plane p = new Plane(Vector3.Zero, new Vector3(0, 1, 0), "p1");
         p.SetShadows(true);
         p.SetMaterial(matte2);
         world.Objects.Add(p);
         PointLight pl = new PointLight();
         pl.Color = Vector3.One;
         pl.Position = new Vector3(0, 4, 0);
         pl.RadianceScale = 1.0f;
         pl.Shadows = true;
         world.Lights.Add(pl);
     }
     catch (Exception e)
     {
         MessageBox.Show(e.StackTrace);
         MessageBox.Show(e.TargetSite.ToString());
     }
 }
开发者ID:JointJBA,项目名称:DisqueEngine,代码行数:50,代码来源:MainWindow.xaml.cs


注:本文中的Plane.SetShadows方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。