本文整理汇总了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();
}
示例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();
}
示例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;
}