In this tutorial again there are only a few small changes that are needed to get this running in XNA 4.0
The first one we carry over from the previous tutorial is the VertexDeclaration changes
So where we initialize myVertexDeclaration in your SetUpVertices method instead of creating a new instance like so:
myVertexDeclaration = new VertexDeclaration(device, VertexPositionColor.VertexElements);
we can use the one from VertexPositionColor which looks like this:
myVertexDeclaration = VertexPositionColor.VertexDeclaration;
The next change is to how we set the Cull mode, this is now a RasterizerState (RenderState was broken down into smaller classes) which is now read-only so rather than being able to just assign the variable we have to create a new instance of the RasterizerState, then assign the CullMode, then assign the RasterizerState to the graphics card.
Which means this line:
device.RenderState.CullMode = CullMode.None;
RasterizerState rs = new RasterizerState();
rs.CullMode = CullMode.None
device.RasterizerState = rs;
And it’s as simple as that, next up Rotation – translation!