Hi, My problem is in the array following this code:
mesh meshCube;
string[] file = File.ReadAllLines("object.mind");
foreach (string filetext in file)
{
if (filetext.Contains("v"))
{
string ext = filetext.Substring(filetext.IndexOf(" ") + 1);
string[] pos = ext.Split(' ');
// erro nessa linha ↓
meshCube.tris.Add( new triangle (
new vec3d(float.Parse(pos[0]), float.Parse(pos[1]), float.Parse(pos[2])),
new vec3d(float.Parse(pos[3]), float.Parse(pos[4]), float.Parse(pos[5])),
new vec3d(float.Parse(pos[6]), float.Parse(pos[7]), float.Parse(pos[8])))
);
}
}
public class vec3d
{
public vec3d(float x, float y, float z)
{
this.x = x;
this.y = y;
this.z = z;
}
public float x { get; set; }
public float y { get; set; }
public float z { get; set; }
}
public class triangle
{
public triangle(vec3d one, vec3d two, vec3d three)
{
p = new[] { one, two, three };
}
public vec3d[] p = new vec3d[3];
}
public class mesh
{
public List<triangle> tris = new List<triangle>();
}