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 Pixel3D
- {
- public int x;
- public int y;
- public short depth = 100;
- private int width;
- private int height;
- public Color color = Color.White;
- public float size = 0.5f;
- public Pixel3D(int x, int y, int width, int height){
- this.x = x;
- this.y = y;
- this.width = width;
- this.height = height;
- }
- public void draw(){
- int relX = x - width / 2;
- int relY = height/2 - y;
- GL.Color4(color);
- GL.Begin(BeginMode.Polygon);
- GL.Vertex3(relX - size, relY + size, -depth);
- GL.Vertex3(relX + size, relY + size, -depth);
- GL.Vertex3(relX + size, relY - size, -depth);
- GL.Vertex3(relX - size, relY - size, -depth);
- GL.End();
- }
- public string toString()
- {
- return "x: " + x + "y: " + y + " depth: " + depth;
- }
- }
- }
|