本文整理汇总了C#中Camera.CreateViewMatrix方法的典型用法代码示例。如果您正苦于以下问题:C# Camera.CreateViewMatrix方法的具体用法?C# Camera.CreateViewMatrix怎么用?C# Camera.CreateViewMatrix使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Camera
的用法示例。
在下文中一共展示了Camera.CreateViewMatrix方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Render
public void Render(Camera camera, double time)
{
Matrix4 worldViewProjection =
Matrix4.Identity *
camera.CreateViewMatrix() *
camera.CreateProjectionMatrix(1280.0f / 720.0f); // HACK: Hardcoded aspect
this.debugShader.UseProgram();
GL.UniformMatrix4(this.debugShader["uWorldViewProjection"], false, ref worldViewProjection);
GL.Uniform3(this.debugShader["uColor"], Vector3.UnitX);
GL.PointSize(5.0f);
this.DrawBuffer(PrimitiveType.Points, this.points);
this.DrawBuffer(PrimitiveType.Lines, this.lines);
this.DrawBuffer(PrimitiveType.Triangles, this.triangles);
GL.UseProgram(0);
}
示例2: RenderPlayer
private void RenderPlayer(Camera cam, Vector3 position, float rotation, double time)
{
Matrix4 world =
Matrix4.CreateRotationY(rotation) *
Matrix4.CreateTranslation(position);
Matrix4 worldViewProjection =
world *
cam.CreateViewMatrix() *
cam.CreateProjectionMatrix(this.Aspect);
GL.UniformMatrix4(this.objectShader["uWorld"], false, ref world);
GL.UniformMatrix4(this.objectShader["uWorldViewProjection"], false, ref worldViewProjection);
this.playerModel.Render(cam, time);
}
示例3: RenderDetail
private void RenderDetail(Camera cam, DetailObject detail, double time)
{
Matrix4 world = detail.Transform;
Matrix4 worldViewProjection =
world *
cam.CreateViewMatrix() *
cam.CreateProjectionMatrix(this.Aspect);
GL.UniformMatrix4(this.objectShader["uWorld"], false, ref world);
GL.UniformMatrix4(this.objectShader["uWorldViewProjection"], false, ref worldViewProjection);
var model = this.GetModelFromName(detail.Model);
if (model != null)
{
model.Render(cam, time);
}
}