iDevGames Forums
Parsing vector graphics files - Printable Version

+- iDevGames Forums (
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Graphics & Audio Programming (/forum-9.html)
+--- Thread: Parsing vector graphics files (/thread-6435.html)

Parsing vector graphics files - aarku - Jul 17, 2004 10:54 PM

I'm trying to find some information or source code about parsing something like an Illustrator AI or EPS file, or any of the vector formats. All I need to be able to do is read in the coordinates of the points of things created using Illustrator's pen tool. I can export from Illustrator into most any vector format, but I haven't been able to find any source or information on reading them.

I tried making a simple illustrator drawing and exporting it into each format, but none of them were very friendly to figure out how to parse the things when I opened them up with a text editor.


Parsing vector graphics files - OneSadCookie - Jul 18, 2004 12:33 AM


Parsing vector graphics files - codemattic - Jul 18, 2004 01:36 AM

I am also doing a 2d side-scroller with polygon/curve backgrounds. Im also using a Rage128 which I can tell you is fast enough for what you want to do. So, some suggestions.

Look at the sourcecode for Rocco's uDevGame 2003 Contest Entry "Adventures on Pirate Isle". In the levels where you go underground into the caves, it uses a polygonal background. He exports from Illustrator to (some format that I forget) and then loads that in - so that should be a big help! I dont see the sourcecode available on his site tho - maybe you could ask him to send it to you since its not linked.

Or, consider generating the terrain randomly for each game! As a player Id like that. You would have to be careful to not let it get too hilly - or for craters to appear right next to each other - but that would be cool.

Or, write your own tool specifically for making 2D terrains.

Or - and this could be an easy way out - use Illustrator to make a black outline of the terrain on a white background - then have Illustrator export as a .tiff (or some bit image format) - and read in the bit image and just scan to see where the non-white pixels are. Then save the data in your own format.

good luck,

Parsing vector graphics files - aarku - Jul 18, 2004 09:35 AM


SVG and Pirate Isle source code look like exactly what I want. I think it was the only vector format that Illustrator could export that I didn't look at! Hopefully I can come up with something nice.