public void AccessPolygons() { FixedList<ColoredPolygon> pols = new FixedList<ColoredPolygon>( new ColoredPolygon(Color.Black, new Vector3(0, 0, 0))); ColoredPolygonMesh mesh = new ColoredPolygonMesh(pols); Assert.AreEqual(mesh.Polygons, pols); }
public MainForm() { InitializeComponent(); airplane = CplLoader.FromByteArray(Mesh.GreenAirplane); Application.Idle += new EventHandler(Application_Idle); keyboard.KeyDown += new KeyDownEvent(keyboard_KeyDown); keyboard.KeyUp += new KeyUpEvent(keyboard_KeyUp); }
public void SingleYellowTriangle() { ColoredPolygon pol = new ColoredPolygon(Color.Yellow, v(0, 1, 2), v(3, 4, 5), v(600, 7, 8)); ColoredPolygonMesh expected = new ColoredPolygonMesh(pol); string repr = @"cpl vertices 3 polygons 1 ---8<--- 0 1 2 3 4 5 600 7 8 3 255 255 0 0 1 2 "; ColoredPolygonMesh result = CplLoader.FromString(repr); Assert.AreEqual(expected, result); }
public void Construct() { List<ColoredPolygon> polygons = new List<ColoredPolygon>(); ColoredPolygonMesh mesh = new ColoredPolygonMesh(polygons); }
private void Form1_Load(object sender, EventArgs e) { GLControlUtil.Init(glControl1, 1000); GLUtil.SunLightDirection(0, 1, 0); mesh = CplLoader.FromString(File.ReadAllText("B.cpl")); }
public static void DrawMeshIgnoreColor(ColoredPolygonMesh coloredPolygonMesh) { DrawMeshInternal(coloredPolygonMesh, true); }
public static void DrawMesh(ColoredPolygonMesh mesh) { DrawMeshInternal(mesh, false); }
private static void DrawMeshInternal( ColoredPolygonMesh mesh, bool ignorecolors) { foreach (ColoredPolygon polygon in mesh) { GL.Begin(BeginMode.Polygon); if(!ignorecolors) GL.Color3(polygon.Color); GL.Normal3(polygon.Normal); foreach (Vector3 v in polygon) GL.Vertex3(v); GL.End(); } }
private void Form1_Load(object sender, EventArgs e) { mesh = CplLoader.FromString(Resources.Tower); GLControlUtil.Init(glCtrl, 1000); GLUtil.SunLightDirection(1, 0, -1); }
private void DrawMesh(ColoredPolygonMesh mesh) { GLUtil.DrawMesh(mesh); }
private void LoadFile(string file) { try { mesh = CplLoader.FromString(File.ReadAllText(file)); } catch { MessageBox.Show("There was an error loading the file."); mesh = null; } glCtrl.Invalidate(); }