From e63155370c817a1d9c16ef798b0a55e6fe328941 Mon Sep 17 00:00:00 2001 From: Adrian Ulbrich Date: Wed, 6 Nov 2019 21:07:49 +0100 Subject: 3d support --- Unicity.Renderer/Shapes/Rectangle.cs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Unicity.Renderer/Shapes/Rectangle.cs (limited to 'Unicity.Renderer/Shapes/Rectangle.cs') diff --git a/Unicity.Renderer/Shapes/Rectangle.cs b/Unicity.Renderer/Shapes/Rectangle.cs new file mode 100644 index 0000000..2239426 --- /dev/null +++ b/Unicity.Renderer/Shapes/Rectangle.cs @@ -0,0 +1,26 @@ +namespace Unicity.Renderer.Shapes +{ + public class Rectangle : Shape + { + Triangle rect1 = null; + Triangle rect2 = null; + + public Rectangle(float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3, float x4, float y4, float z4) + { + rect1 = new Triangle(x1, y1, z1, x2, y2, z2, x3, y3, z3); + rect2 = new Triangle(x3, y3, z3, x2, y2, z2, x4, y4, z4); + } + + internal override void Draw(Shader shader, GraphicsRenderer renderer) + { + rect1.Draw(shader, renderer); + rect2.Draw(shader, renderer); + } + + public override void Dispose() + { + rect1.Dispose(); + rect2.Dispose(); + } + } +} -- cgit v1.2.3