public void Draw(System.Drawing.Graphics g, System.Drawing.Brush b, Ratchet.Math.mat4 model, Ratchet.Math.mat4 view, Ratchet.Math.mat4 projection) { Triangle3 t = (projection * (view * (model * this))); Ratchet.Math.vec2 p1 = new Ratchet.Math.vec2(t.p1.x / t.p1.z, -t.p1.y / t.p1.z); Ratchet.Math.vec2 p2 = new Ratchet.Math.vec2(t.p2.x / t.p2.z, -t.p2.y / t.p2.z); Ratchet.Math.vec2 p3 = new Ratchet.Math.vec2(t.p3.x / t.p3.z, -t.p3.y / t.p3.z); g.FillPolygon(b, new PointF[] { new PointF((p1.x + 1.0f) * (640 / 2), (p1.y + 1.0f) * (480 / 2)), new PointF((p2.x + 1.0f) * (640 / 2), (p2.y + 1.0f) * (480 / 2)), new PointF((p3.x + 1.0f) * (640 / 2), (p3.y + 1.0f) * (480 / 2)) }); }
public Quad3(Triangle3 t1, Triangle3 t2) { this.t1 = t1; this.t2 = t2; }
public Quad3(Ratchet.Math.vec3 p1, Ratchet.Math.vec3 p2, Ratchet.Math.vec3 p3, Ratchet.Math.vec3 p4) { t1 = new Triangle3(p1, p2, p3); t2 = new Triangle3(p1, p3, p4); }