public void GenerateTextTexCoords() { var mesh = new An8Mesh(); mesh.TexCoords.Add(new An8TexCoord { U = 2.0f, V = 3.0f }); var text = mesh.GenerateText(); string expected = @"mesh { name { """" } smoothangle { 0.000000 } materiallist { } points { } normals { } edges { } texcoords { ( 2.000000 3.000000 ) } faces { } } "; Assert.Equal( expected.Replace("\r\n", "\n"), text.Replace("\r\n", "\n")); }
public void GenerateTextFaces() { var mesh = new An8Mesh(); mesh.Faces.Add(new An8Face()); var text = mesh.GenerateText(); string expected = @"mesh { name { """" } smoothangle { 0.000000 } materiallist { } points { } normals { } edges { } texcoords { } faces { 0 0 0 0 ( ) } } "; Assert.Equal( expected.Replace("\r\n", "\n"), text.Replace("\r\n", "\n")); }
public void GenerateTextMaterialList() { var mesh = new An8Mesh(); mesh.MaterialList.Add("abc"); var text = mesh.GenerateText(); string expected = @"mesh { name { """" } smoothangle { 0.000000 } materiallist { materialname { ""abc"" } } points { } normals { } edges { } texcoords { } faces { } } "; Assert.Equal( expected.Replace("\r\n", "\n"), text.Replace("\r\n", "\n")); }
public void GenerateTextSmoothAngle() { var mesh = new An8Mesh(); mesh.SmoothAngleThreshold = 2.0f; var text = mesh.GenerateText(); string expected = @"mesh { name { """" } smoothangle { 2.000000 } materiallist { } points { } normals { } edges { } texcoords { } faces { } } "; Assert.Equal( expected.Replace("\r\n", "\n"), text.Replace("\r\n", "\n")); }
public void GenerateTextNormalsAndTexCoords() { var face = new An8Face(); face.IsBackShown = true; face.MaterialIndex = 4; face.FlatNormalIndex = 5; face.PointIndexes = new int[] { 10, 13, 16 }; face.NormalIndexes = new int[] { 11, 14, 17 }; face.TexCoordIndexes = new int[] { 12, 15, 18 }; var mesh = new An8Mesh(); mesh.Faces.Add(face); var text = mesh.GenerateText(); string expected = @"mesh { name { """" } smoothangle { 0.000000 } materiallist { } points { } normals { } edges { } texcoords { } faces { 3 7 4 5 ( ( 10 11 12 ) ( 13 14 15 ) ( 16 17 18 ) ) } } "; Assert.Equal( expected.Replace("\r\n", "\n"), text.Replace("\r\n", "\n")); }
public void GenerateTextEdges() { var mesh = new An8Mesh(); mesh.Edges.Add(new An8Edge { Index1 = 2, Index2 = 3 }); mesh.Edges.Add(new An8Edge { Index1 = 4, Index2 = 5, Sharpness = 6 }); var text = mesh.GenerateText(); string expected = @"mesh { name { """" } smoothangle { 0.000000 } materiallist { } points { } normals { } edges { ( 2 3 ) ( 4 5 6 ) } texcoords { } faces { } } "; Assert.Equal( expected.Replace("\r\n", "\n"), text.Replace("\r\n", "\n")); }
public void GenerateTextPoints() { var face = new An8Face(); face.MaterialIndex = 4; face.FlatNormalIndex = 5; face.PointIndexes = new int[] { 10, 13, 16 }; var mesh = new An8Mesh(); mesh.Faces.Add(face); var text = mesh.GenerateText(); string expected = @"mesh { name { """" } smoothangle { 0.000000 } materiallist { } points { } normals { } edges { } texcoords { } faces { 3 0 4 5 ( ( 10 ) ( 13 ) ( 16 ) ) } } "; Assert.Equal( expected.Replace("\r\n", "\n"), text.Replace("\r\n", "\n")); }