Game Development Reference
In-Depth Information
point pairs instead of data point triplets. If you recall back in Table 16-1 , the only SVG
command that uses triplet (three) X,Y data point pairs is the C , or Cubic Bezier
(Spline) Curve. Sure enough, as you see in Figure 16-15 , right under the M (moveto)
opening SVG command is the C command. This explains why GIMP put three data
points in each point in your polygon. The reason all the data point triplets have the
same value is because we checked the polygon option in GIMP. This puts the spline
curve control handles “away” or out of sight, directly on top of the X,Y data point. This
defines zero curvature, or the square polygon structure seen in Figure 16-14 .
Let's export the SVG data with the triplets removed, which is shown in Figure
16-15 , and see what the result looks like in GIMP, using our newfound Import Path
work process, primarily for learning purposes, as we are not quite finished with the op-
timization work process.
Figure 16-15 . Remove duplicate point data for those points in the interior of the collision polygon, to further optimize
Save the XML data shown in Figure 16-15 as sprite1svghandintegerxmloptim-
ized.txt and then use the same Import Path work process, shown in Figures 16-12 and
6-13, to import this further optimized SVG data set into GIMP. As you can see in Fig-
ure 16-16 , removing those cubic Bezier curve control handles from the data set also re-
moves the polygonal nature of your collision polygon. So, we will need to do some fur-
ther work on our SVG data to correct this.
 
 
 
Search WWH ::




Custom Search