Building Web Applications with SVG - Cdn.oreilly.com
Building Web Applications with SVG - Cdn.oreilly.com
Building Web Applications with SVG - Cdn.oreilly.com
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
example 10: Using to Simulate Digital<br />
elevation Maps<br />
<strong>SVG</strong> is still evolving. Version 2 of the specification is presently under deliberation by the W3C’s Working<br />
Group. While the language currently has only two types of gradients (linear and radial), several proposals<br />
exist for increasing that number. One, the proposal to allow declarative markup to create many objects<br />
that are tweened from one another—like animation, only spatial rather than temporal—is to use<br />
. While would handle a wide variety of issues (such as this rotatable 3D portrayal<br />
of a geographic landform), other proposals are considerably less broad in scope.<br />
Here’s how it’s done:<br />
■■ Interpolating between paths In this example, which you can find at http://srufaculty.sru<br />
.edu/david.dailey/svg/dem/DEM_1.svg, many concentric polygons (<strong>with</strong> varying numbers of<br />
points in their definition) are defined through interpolation and then cloned.<br />
■■ Simulating 3D rotation Script then manipulates the data to enable rotation in three<br />
dimensions.<br />
Example 11: Non-Affine Cobblestones<br />
Here’s another example showing the use of (see http://srufaculty.sru.edu/david.dailey/svg/<br />
replicate/repRectsGrad2g.svg). This example replicates interpolated polygons in two directions. While<br />
is not (yet) supported by the <strong>SVG</strong> specification, it is supported through an open source<br />
JavaScript initiative that allows <strong>SVG</strong>-like declarative markup to be interspersed <strong>with</strong> actual <strong>SVG</strong> to create<br />
a wide range of effects.<br />
CHAPTER 1 <strong>SVG</strong> Basics 17