Creating the 3D city

In this tutorial we are just going to carry over some of the changes from the last one, since the only method we need to change is copied from it and extended.

So we change this line in the SetUpVertices() method:
cityVertexBuffer = new VertexBuffer(device, verticesList.Count * VertexPositionNormalTexture.SizeInBytes, BufferUsage.WriteOnly);

cityVertexBuffer.SetData (verticesList.ToArray());

to this:

cityVertexBuffer = new VertexBuffer(device, typeof(VertexPositionNormalTexture) ,verticesList.Count, BufferUsage.WriteOnly);


And again remove this line:

texturedVertexDeclaration = new VertexDeclaration(device, VertexPositionNormalTexture.VertexElements);

And that is all for this tutorial, next step Loading a model.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s