private PrimitiveObject GetTexturedPyramidSquare(GraphicsDevice graphics, ShapeType shapeType, EffectParameters effectParameters) { //get the vertices VertexPositionColorTexture[] vertices = PrimitiveUtility.GetTexturedPyramidSquare(out primitiveType, out primitiveCount); vertexData = new BufferedVertexData <VertexPositionColorTexture>(graphics, vertices, primitiveType, primitiveCount); //instanciate the object and return a reference return(GetPrimitiveObjectFromVertexData(vertexData, shapeType, effectParameters)); }
private PrimitiveObject GetNormalTexturedCube(GraphicsDevice graphics, ShapeType shapeType, EffectParameters effectParameters) { //get the vertices VertexPositionNormalTexture[] vertices = PrimitiveUtility.GetNormalTexturedCube(out primitiveType, out primitiveCount); //create the buffered data using indexed since it will reduce the number of vertices required from 36 - 12 - see GetTexturedCube() comment vertexData = new IndexedBufferedVertexData <VertexPositionNormalTexture>(graphics, vertices, primitiveType, primitiveCount); //instanciate the object and return a reference return(GetPrimitiveObjectFromVertexData(vertexData, shapeType, effectParameters)); }
private PrimitiveObject GetWireframeSpiral(GraphicsDevice graphics, ShapeType shapeType, EffectParameters effectParameters) { //get the vertices VertexPositionColor[] vertices = PrimitiveUtility.GetWireframeSpiral(15, 1, out primitiveType, out primitiveCount); //create the buffered data vertexData = new BufferedVertexData <VertexPositionColor>(graphics, vertices, primitiveType, primitiveCount); //instanciate the object and return a reference return(GetPrimitiveObjectFromVertexData(vertexData, shapeType, effectParameters)); }
private PrimitiveObject GetColoredQuad(GraphicsDevice graphics, ShapeType shapeType, EffectParameters effectParameters) { //vertex colors for the quad Color[] vertexColorArray = { Color.Red, Color.Green, Color.Blue, Color.Orange }; //get the vertices VertexPositionColor[] vertices = PrimitiveUtility.GetColoredQuad(vertexColorArray, out primitiveType, out primitiveCount); //create the buffered data vertexData = new BufferedVertexData <VertexPositionColor>(graphics, vertices, primitiveType, primitiveCount); //instanciate the object and return a reference return(GetPrimitiveObjectFromVertexData(vertexData, shapeType, effectParameters)); }
private PrimitiveObject GetTexturedCube(GraphicsDevice graphics, ShapeType shapeType, EffectParameters effectParameters) { //get the vertices VertexPositionColorTexture[] vertices = PrimitiveUtility.GetTexturedCube(out primitiveType, out primitiveCount); /* * Remember we saw in PrimitiveUtility.GetTexturedCube() that we were using too many vertices? * We can use IndexedBufferedVertexData to now reduce the 36 vertices to 12. * * Notice however that we are STILL using TriangleList as our PrimitiveType. The optimal solution is to use an IndexedBufferedVertexData object where you define the indices and vertices * and also choose TriangleStrip or LineStrip as your PrimitiveType. */ vertexData = new IndexedBufferedVertexData <VertexPositionColorTexture>(graphics, vertices, primitiveType, primitiveCount); //instanciate the object and return a reference return(GetPrimitiveObjectFromVertexData(vertexData, shapeType, effectParameters)); }