12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Drawing;
- using OpenTK;
- using OpenTK.Graphics.OpenGL;
- using MathNet.Numerics.LinearAlgebra.Single;
- namespace bbiwarg.Test
- {
- class Triangle
- {
- public Pixel3D a;
- public Pixel3D b;
- public Pixel3D c;
- public Color color = Color.Red;
- public Triangle(Pixel3D a, Pixel3D b, Pixel3D c)
- {
- this.a = a;
- this.b = b;
- this.c = c;
- }
- public void draw()
- {
- a.draw();
- b.draw();
- c.draw();
- GL.Color3(color);
- GL.Begin(BeginMode.Triangles);
- GL.Vertex3(a.x, a.y, a.depth);
- GL.Vertex3(b.x, b.y, b.depth);
- GL.Vertex3(c.x, c.y, c.depth);
- GL.End();
- }
- public void setPixel(Pixel3D a, Pixel3D b, Pixel3D c)
- {
- this.a = a;
- this.b = b;
- this.c = c;
- }
-
- }
- }
|