public override void Render(Camera camera = null, float[,] projectionMatrix = null) { if (camera is null) { if (Camera.mainCamera != null) { camera = Camera.mainCamera; } else { throw new Exception("No camera set!"); } } if (projectionMatrix is null) { projectionMatrix = MatrixProjections.GetOrthoProjection(640f / 480f, 1, 0, 5); } shader.Bind(); tex.SetActiveTexture(0); buffers.vao.Bind(); shader.SetUniform("model", transform.GetModelMatrix()); shader.SetUniform("view", camera.transform.GetModelMatrix()); shader.SetUniform("projection", projectionMatrix); Gl.DrawElements(0x004, 6, 0x1405, 0); }
public float[,] GetModelMatrix() { return(MatrixProjections.Translation(position)); }