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


C# Camera.BuildView方法代码示例

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


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

示例1: SetCamera

 protected void SetCamera(Camera cam)
 {
     Camera = cam;
     Camera.Aspect = (float)Width / (float)Height;
     Camera.Fov = Math.Max(cam.Fov, 65.0f);
     Camera.RotationVel = 100.0f;
     Camera.TranslationVel = 100.0f;
     cam.BuildView();
     CameraUpdate();
 }
开发者ID:HungryBear,项目名称:Phantom,代码行数:10,代码来源:MainForm.cs

示例2: SetCamera

 protected void SetCamera(Camera cam)
 {
     Camera = cam;
     Camera.Aspect = (float)Width / (float)Height;
     Camera.Fov = StartingFov;
     Camera.RotationVel = 100.0f;
     Camera.TranslationVel = 100.0f;
     cam.BuildView();
     CameraUpdate();
 }
开发者ID:HungryBear,项目名称:Phantom,代码行数:10,代码来源:MEForm.cs

示例3: Build

        public void Build(SceneGraph scene)
        {
            BuildCache = new Dictionary<string, object>(StringComparer.CurrentCultureIgnoreCase);
            var camera = scene.First<SceneCamera>();
            Guard.NotNull(camera, "Couldn't find camera in scene");

            var cameras = scene.OfType<SceneCamera>().ToArray();
            Cameras = new Camera[cameras.Length];
            for (int i = 0; i < cameras.Length; i++)
            {
                Cameras[i] = new Camera();
                Cameras[i].LookAt(cameras[i].Position, cameras[i].Direction, cameras[i].Up);
                Cameras[i].Fov = camera.Fov;
                Cameras[i].BuildView();
            }

            var sceneGeometryData = scene.First<SceneMeshData>();
            Guard.NotNull(sceneGeometryData, "Couldn't find sceneGeometryData in scene");
            var sceneGeometry = scene.Subset<SceneMeshEntity>().ToArray();
            Guard.NotNullOrEmpty(sceneGeometry, "No scene geometry present");
            var sceneMaterials = scene.Subset<SceneMaterial>().ToArray();
            Guard.NotNullOrEmpty(sceneMaterials, "No scene materials present");
            var sceneLights = scene.Subset<SceneLightsource>().ToArray();
            Guard.NotNullOrEmpty(sceneLights, "No scene lightsources present");
            var sceneResources = scene.Subset<SceneResourceReference>().ToArray();
            Camera = new Camera();
            Camera.LookAt(camera.Position, camera.Direction, camera.Up);
            Camera.Fov = camera.Fov;
            Camera.BuildView();

            Tracer.WriteLine("Start Building Materials");
            this.BuildMaterials(sceneMaterials, sceneResources);

            BuildCache.Add("Materials", sceneMaterials);

            Tracer.WriteLine("Start Building Geometry");
            var areaLights = sceneLights.Where(lt => lt.LightType == LightSourceTypes.Area).ToArray();

            if (areaLights.Any())
            {
                BuildCache.Add("AreaLights", areaLights.ToArray());
            }

            this.BuildGeometry(sceneGeometryData, sceneGeometry, areaLights.Any(), areaLights);
            this.BoundingSphereRadius = sceneGeometryData.BoundingSphereRadius;
            BuildCache.Add("Geometry", sceneGeometry);

            Tracer.WriteLine("Start Building Lightsources");
            this.BuildLights(sceneLights);

            Session.Frame.TopObject = this.topObject;
        }
开发者ID:HungryBear,项目名称:Phantom,代码行数:52,代码来源:OptixSceneBuilder.cs


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