Wednesday, November 19, 2008

The World

There are two ways XNA can draw lines. As a LineStrip, where we get one long line going through all the points from start to finish. Or a ListList, which gives individual lines between points.

For drawing the world border data, I needed a bit of both, continuous lines around a country, but each country is separate from each other.

Since all the vertex data is in one array, it needs a list of indices to tell the graphics card which lines to draw.

If I had any graphical talent, I would come up with a fancy diagram explaining what I mean... but I don't.


After creating the vertices and the indices, they can then be copied to the graphics card, and unless they need to be changed, they will only need to be copied once, which gives a huge boost to performance.


As I mentioned in my previous post, I wrote an importer for the Xbase file that comes with the shape file. Here is a screen shot of the countries with their names.



At the moment I can scroll around the world, and zoom in and out. However what will be more difficult is getting the world to wrap around in the East and West direction.

No comments: