@dale i changed your command to have still colors like
private Mesh CreateMeshBox()
{
var mesh = new Mesh();
mesh.Vertices.Add(new Point3d(0.5, 0.5, 0.5));
mesh.Vertices.Add(new Point3d(0.5, 0.5, -0.5));
mesh.Vertices.Add(new Point3d(0.5, -0.5, 0.5));
mesh.Vertices.Add(new Point3d(0.5, -0.5, -0.5));
mesh.Vertices.Add(new Point3d(-0.5, 0.5, 0.5));
mesh.Vertices.Add(new Point3d(-0.5, 0.5, -0.5));
mesh.Vertices.Add(new Point3d(-0.5, -0.5, 0.5));
mesh.Vertices.Add(new Point3d(-0.5, -0.5, -0.5));
mesh.Faces.AddFace(0, 1, 5, 4);
mesh.Faces.AddFace(0, 4, 6, 2);
mesh.Faces.AddFace(0, 2, 3, 1);
mesh.Faces.AddFace(7, 3, 2, 6);
mesh.Faces.AddFace(7, 6, 4, 5);
mesh.Faces.AddFace(7, 5, 1, 3);
//for (var i = 0; i < mesh.Vertices.Count; i++)
mesh.VertexColors.Add(Color.Red);
mesh.VertexColors.Add(Color.Green);
mesh.VertexColors.Add(Color.Blue);
mesh.VertexColors.Add(Color.Yellow);
mesh.VertexColors.Add(Color.Magenta);
mesh.VertexColors.Add(Color.Orange);
mesh.VertexColors.Add(Color.White);
mesh.VertexColors.Add(Color.Teal);
mesh.FaceNormals.ComputeFaceNormals();
mesh.Normals.ComputeNormals();
mesh.Compact();
return mesh;
}
and i get again black flickering normals:
[Edit] I tried now:
for (var i = 0; i < mesh.Vertices.Count; i++)
mesh.VertexColors.Add(Color.Red);
So difference is that i dont calculete normals for this mesh and it is black
when i add:
mesh.FaceNormals.ComputeFaceNormals();
mesh.Normals.ComputeNormals();
i get this:
and black ones are flickering randomly while rotating - and in my scenario i want uniform boxes without shading like i showed in post number 5 of this topic
and just to be clear with above full example like:
for (var i = 0; i < mesh.Vertices.Count; i++)
mesh.VertexColors.Add(Color.Red);
mesh.FaceNormals.ComputeFaceNormals();
mesh.Normals.ComputeNormals();
mesh.Compact();
i have this desired result: