preparing vector graphics for use in a game
December 21, 2008 9:30 PM
Subscribe
how to convert a vector drawing to line segments & convex polygons, and then export as an array of points?
Hello,
I'm looking to convert vector artwork for a 2d video game into a format that can be used by code. Ideally I'd like a flexible semi-automated way to convert a vector drawing into an array of points which define line segments and/or convex polygons.
The vector artwork is curved.
The line segments, and polygon edges will naturally be straight.
I will want to make compromises between the number of points used, and how faithfully the original artwork is represented to find a good trade off between the appearance while keeping the number of points used low.
does anyone have any suggestions?
thanks
mat
posted by compound eye to computers & internet (7 comments total)
3 users marked this as a favorite
The vector artwork's curves are probably splines.
OpenGL can handle splines natively. I assume DirectX can too, although I've never used it. Using the appropriate API calls for splines will get your video card to do the discretization heavy lifting.
posted by qxntpqbbbqxl at 10:39 PM on December 21, 2008