本文整理匯總了C#中Camera.CreateProjectionMatrix方法的典型用法代碼示例。如果您正苦於以下問題:C# Camera.CreateProjectionMatrix方法的具體用法?C# Camera.CreateProjectionMatrix怎麽用?C# Camera.CreateProjectionMatrix使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Camera
的用法示例。
在下文中一共展示了Camera.CreateProjectionMatrix方法的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);
}
}