本文整理汇总了C#中ICamera.CreateViewMatrix方法的典型用法代码示例。如果您正苦于以下问题:C# ICamera.CreateViewMatrix方法的具体用法?C# ICamera.CreateViewMatrix怎么用?C# ICamera.CreateViewMatrix使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ICamera
的用法示例。
在下文中一共展示了ICamera.CreateViewMatrix方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UpdateBuffer
/****************************************************************************************************
*
****************************************************************************************************/
public void UpdateBuffer(DeviceContext context, Matrix world, ICamera camera)
{
var view = camera.CreateViewMatrix();
var projection = camera.CreateProjectionMatrix(Resolution);
Matrices[0] = Matrix.Transpose(world);
Matrices[1] = Matrix.Transpose(view);
Matrices[2] = Matrix.Transpose(projection);
Matrices[3] = Matrix.Transpose(world * view);
Matrices[4] = Matrix.Transpose(world * view * projection);
Matrices[5] = Matrix.Transpose(view * projection);
Matrices[6] = Matrix.Invert(world);
Matrices[7] = Matrix.Invert(world * view);
Matrices[8] = Matrix.Transpose(Matrix.Identity * Matrix.Scaling(LightPosition));
Matrices[9] = new Matrix(new float[]
{
LerpTime, AbsoluteTime, Resolution.X, Resolution.Y,
BeatTime, Lead,0,0,
Nisse0, Nisse1, Nisse2, Nisse3,
0,0,0,0,
});
if (Buffer == null)
{
Buffer = new Buffer(context.Device, Matrices.Length * Utilities.SizeOf<Matrix>(), ResourceUsage.Default, BindFlags.ConstantBuffer, CpuAccessFlags.None, ResourceOptionFlags.None, 0);
}
context.UpdateSubresource(Matrices, Buffer);
}