public DrawTriangle ( Point a, Point b, Point c, |
||
a | Point | The first point of the triangle. |
b | Point | The second point of the triangle. |
c | Point | The third point of the triangle. |
brush | The brush of the line. | |
return | void |
/// <summary> /// Render the current scene to the active buffer. /// </summary> /// <param name="buffer"></param> public void Render(ConsoleBuffer buffer) { foreach (Renderable obj in Objects) foreach (Face face in obj.Faces) foreach (Triangle3f tri in face.Triangles) { Vector2 point1 = ActiveCamera.ProjectVector(buffer.Width, buffer.Height, tri.A, obj.ModelMatrix); Vector2 point2 = ActiveCamera.ProjectVector(buffer.Width, buffer.Height, tri.B, obj.ModelMatrix); Vector2 point3 = ActiveCamera.ProjectVector(buffer.Width, buffer.Height, tri.C, obj.ModelMatrix); buffer.DrawTriangle(point1.ToPoint(), point2.ToPoint(), point3.ToPoint(), face.Color); } }
/// <summary> /// Render the current scene to the active buffer. /// </summary> /// <param name="buffer"></param> public void Render(ConsoleBuffer buffer) { foreach (Renderable obj in Objects) { foreach (Face face in obj.Faces) { foreach (Triangle3f tri in face.Triangles) { Vector2 point1 = ActiveCamera.ProjectVector(buffer.Width, buffer.Height, tri.A, obj.ModelMatrix); Vector2 point2 = ActiveCamera.ProjectVector(buffer.Width, buffer.Height, tri.B, obj.ModelMatrix); Vector2 point3 = ActiveCamera.ProjectVector(buffer.Width, buffer.Height, tri.C, obj.ModelMatrix); buffer.DrawTriangle(point1.ToPoint(), point2.ToPoint(), point3.ToPoint(), face.Color); } } } }