public void Parse_for_Normals() { var sourceElement = mMesh.Elements() .Where(s => s.Attribute("id").Value == "Plane-Geometry-Normals") .FirstOrDefault(); Assert.IsNotNull(sourceElement); var sourceParser = new SourceParser(sourceElement); var normals = sourceParser.Parse(); Assert.IsNotNull(normals); var expected = new[] { new[] { 0f, 0f, 1f }, new[] { 0f, 0f, 1f }, }; Assert.AreElementsEqual(expected, normals.ToArray()); }
public void Parse_for_Positions() { var sourceElement = mMesh.Elements() .Where(s => s.Attribute("id").Value == "Plane-Geometry-Position") .FirstOrDefault(); Assert.IsNotNull(sourceElement); var sourceParser = new SourceParser(sourceElement); var positions = sourceParser.Parse(); Assert.IsNotNull(positions); var expected = new[] { new[] { 1f, 1f, 0f }, new[] { 1f, -1f, 0f }, new[] { -1f, -1f, 0f }, new[] { -1f, 1f, 0f } }; Assert.AreElementsEqual(expected, positions.ToArray()); }
public void Parse_for_Colors() { var sourceElement = mMesh.Elements() .Where(s => s.Attribute("id").Value == "Plane-Geometry-color") .FirstOrDefault(); Assert.IsNotNull(sourceElement); var sourceParser = new SourceParser(sourceElement); var texCoords = sourceParser.Parse(); Assert.IsNotNull(texCoords); var expected = new[] { new[] { 1f, 1f, 1f, 1f }, new[] { 1f, 1f, 1f, 1f }, new[] { 1f, 1f, 1f, 1f }, new[] { 1f, 1f, 1f, 1f }, new[] { 1f, 1f, 1f, 1f }, new[] { 1f, 1f, 1f, 1f }, }; Assert.AreElementsEqual(expected, texCoords.ToArray()); }