public void SubdivisionEllipsoidTessellatorTest() { Mesh sphere = SubdivisionSphereTessellator.Compute(1, SubdivisionSphereVertexAttributes.All); Mesh ellipsoid = SubdivisionEllipsoidTessellator.Compute(Ellipsoid.UnitSphere, 1, SubdivisionEllipsoidVertexAttributes.All); GraphicsAssert.ListsAreEqual( ((IndicesUnsignedInt)sphere.Indices).Values, ((IndicesUnsignedInt)ellipsoid.Indices).Values); GraphicsAssert.ListsAreEqual( ((VertexAttributeDoubleVector3)sphere.Attributes["position"]).Values, ((VertexAttributeDoubleVector3)ellipsoid.Attributes["position"]).Values); GraphicsAssert.ListsAreEqual( ((VertexAttributeHalfFloatVector3)sphere.Attributes["normal"]).Values, ((VertexAttributeHalfFloatVector3)ellipsoid.Attributes["normal"]).Values); GraphicsAssert.ListsAreEqual( ((VertexAttributeHalfFloatVector2)sphere.Attributes["textureCoordinate"]).Values, ((VertexAttributeHalfFloatVector2)ellipsoid.Attributes["textureCoordinate"]).Values); }
public void SubdivisionSphereTessellatorTest() { Mesh simpleSphere = SubdivisionSphereTessellatorSimple.Compute(1); Assert.AreEqual(IndicesType.UnsignedInt, simpleSphere.Indices.Datatype); Assert.AreEqual(1, simpleSphere.Attributes.Count); Assert.IsNotNull(simpleSphere.Attributes["position"] as VertexAttributeDoubleVector3); Mesh sphere = SubdivisionSphereTessellator.Compute(1, SubdivisionSphereVertexAttributes.All); Assert.AreEqual(IndicesType.UnsignedInt, sphere.Indices.Datatype); Assert.AreEqual(3, sphere.Attributes.Count); Assert.IsNotNull(sphere.Attributes["position"] as VertexAttributeDoubleVector3); Assert.IsNotNull(sphere.Attributes["normal"] as VertexAttributeHalfFloatVector3); Assert.IsNotNull(sphere.Attributes["textureCoordinate"] as VertexAttributeHalfFloatVector2); GraphicsAssert.ListsAreEqual( ((IndicesUnsignedInt)simpleSphere.Indices).Values, ((IndicesUnsignedInt)sphere.Indices).Values); GraphicsAssert.ListsAreEqual( ((VertexAttributeDoubleVector3)simpleSphere.Attributes["position"]).Values, ((VertexAttributeDoubleVector3)sphere.Attributes["position"]).Values); }