-
Notifications
You must be signed in to change notification settings - Fork 0
/
SceneObjects.cs
74 lines (61 loc) · 1.74 KB
/
SceneObjects.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.InteropServices;
namespace render
{
public class Color
{
public static Color _Red => new Color(0, 0, 255, 255);
public static Color _Green => new Color(0, 255, 0, 255);
public static Color _Blue => new Color(255, 0, 0, 255);
public static Color _White => new Color(255, 255, 255, 255);
public static Color _Black => new Color(0, 0, 0, 255);
public byte Blue { get; set; }
public byte Green { get; set; }
public byte Red { get; set; }
public byte Alpha { get; set; }
public Color(byte blue, byte green, byte red, byte alpha)
{
Blue = blue;
Green = green;
Red = red;
Alpha = alpha;
}
public Color mix(Color color2, double part2)
{
return new Color((byte)(Blue * (1.0 - part2) + color2.Blue * part2), (byte)(Green * (1.0 - part2) + color2.Green * part2), (byte)(Red * (1.0 - part2) + color2.Red * part2), (byte)(Alpha * (1.0 - part2) + color2.Alpha * part2));
}
}
public class Point
{
public Color Color;
public Vector3 Pos;
public Point(Color color, Vector3 position)
{
Color = color;
Pos = position;
}
}
public class SceneObject
{
public Mesh mesh;
}
public abstract class Mesh
{
public Point[] points;
}
public class MeshWire : Mesh
{
public int[][] links;
}
public class MeshFilled : Mesh
{
public int[][] links;
}
public class MeshTriangled : Mesh
{
public int[][] facets;
}
}