-1

How to convert this code part from XNA 3.1 to XNA 4.0.
If someone knows please help.

public ModelLightMesh(Viewer3D viewer, Vector3 position, float radius, Color color, float u0, float v0, float u1, float v1)
    {
        var verticies = new[] {
            new VertexPositionColorTexture(new Vector3(position.X - radius, position.Y + radius, position.Z), color, new Vector2(u1, v0)),
            new VertexPositionColorTexture(new Vector3(position.X + radius, position.Y + radius, position.Z), color, new Vector2(u0, v0)),
            new VertexPositionColorTexture(new Vector3(position.X + radius, position.Y - radius, position.Z), color, new Vector2(u0, v1)),
            new VertexPositionColorTexture(new Vector3(position.X - radius, position.Y - radius, position.Z), color, new Vector2(u1, v1)),
        };
        VertexDeclaration = new VertexDeclaration(viewer.GraphicsDevice, VertexPositionColorTexture.VertexElements);
        VertexBuffer = new VertexBuffer(viewer.GraphicsDevice, VertexPositionColorTexture.SizeInBytes * verticies.Length, BufferUsage.WriteOnly);
        VertexBuffer.SetData(verticies);
    }
Dylan Corriveau
  • 2,561
  • 4
  • 29
  • 36
Tasleem
  • 11
  • 2

1 Answers1

1

Microsoft highlighted the differences in a series of MSDN articles along with code examples.

You can also use the cheat sheet provided here:

http://nelxon.com/resources/xna-3-1-to-xna-4-0-cheatsheet.php

Articles:

PS: Your answer may have been downvoted, because you didn't specifically run into trouble and asked about concrete issues?

Lorenz Lo Sauer
  • 23,698
  • 16
  • 85
  • 87