O'Reilly logo

Inkscape 0.48 Illustrator's Cookbook by Mihaela Jurković, Rigel Di Scala

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating an interactive physics simulation

This recipe will show us how powerful SVG can be as an educational tool. We will create a drawing of a simple Monochromator optical device, consisting of a light source and a prism, and use a script to generate SVG light beams that simulate the light refraction according to the laws of physics. The drawing will contain widgets that change various physics parameters that influence the "experiment" results, and the script will ensure that the behavior will be realistic.

Although most of the work for this recipe is contained in the script, it is still a useful example of how Inkscape and SVG can be very flexible tools in various simulations and interactive illustrations.

How to do it...

The following steps ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required