continua (next page) Index of UNOFFICIAL Circumvesuviana Home Page main index Clicca qui per alcune note in italiano.

What about freehand line drawing with POVray? Here is my quickest'n'dirtiest solution!

Start the sodipodi package (it's Gnome stuff), select freehand writing, draw a curve; sodipodi "vectorizes" it, and then you can save all to his SVG format file (it's actually contained in an XML uncompressed file).

The freehand-drawn curve is saved as a curve with control points; the POVray spline functions seem to behave quite well taking out that curve: ignoring the control points gives out a decent draft, and with some trickery I can import it as a sphere_sweep object in KPovModeler.

Since I cannot import POV file, I had to write a little program that scans the beginning of the "d" node of the first "path" object found. It then outputs a compressed XML format suitable for loading in KPovModeller (it just seems a .kpm file containing a simple object), moving the coordinates to x and z axes (nice when one works on the upside view). The only little drawback, also correctable with a rotate instruction, is the orientation of sodipodi's coordinates.

I know that my dirty hack is only a "five minutes trick", but it made me able to immediately draft a number of curves and then "sweep" them into my kpovmodeler scene. Since the process involves fetching and placing some data between XML containers, I hope that someone will write a decent "import curves from SVG file" (working out the control points, maybe "bezierating" them) or even a decent generic freehand tool for KPovModeler...

Well, I wrote (using my mouse!) "Povray freehand demo" (well, it surely will be nicer using a pen+tablet, but I only have a mouse and a trackpad here). Then I imported the single curves in the KPovModeler scene, changed a few minor details, added glass-like media, a single light point and photons effect, and here it is the final image! (note that it required nine hours to render on a Celeron/1000).

I think that with minimum (or even none) effort, you will be able to get more from other vector-drawing programs like sodipodi (anyways, I mentioned here only free software: sodipodi, kpovmodeler, povray, you don't have to pay to use them).


Some italian notes...

Insomma, m'è venuta la mania di disegnare a mano libera e poi di importare in KPovModeler per farli tracciare da POVray... l'esperimento è riuscito abbastanza bene, anche se è assai grezzo. Ho usato sodipodi (della collezione di Gnome) per tracciare la curva, ed ho scritto un programmino in C per recuperarla come oggetto di KPovModeler. Il risultato finale, di poco più di mezz'ora di lavoro totale (tra redazione del programma in C e smanettamenti con KPovModeler) è l'immagine qui sotto (che ha richiesto nove ore circa di rendering su un Celeron/1000, a causa degli effetti "vetro", "fotoni" e "radiosity" di POVray).

Some extra notes

I don't like to use a changing radius for the sweep_sphere, although in some (rare) cases it may be useful. A fixed radius on a cubic_spline sweep_sphere will have the real freehand feeling, as shown on the image below. Some weird effect can be obtained changing to Bezier-type spline. I think that this solution is useless with linear splines.

With KPovModeler you can still draw your own splines, but if you want to build some freehand-style drawing like the one below, you will have a rather hard day (the image below contains five sphere_sweep objects, from 9 to 45 points each).

Click here to download the ugly C code that translates a sodipodi curve to a kpovmodeler sphere_sweep object. If you want to experiment, just remember that the starting and ending points will be drawn in the sodipodi canvas, but will be invisible in the sphere_sweep object.

Click here to download the nice KPovModeler scene file that KPovModeler can render through POVray 3.5 or later.


Click here for raytracing index page.

Ray Tracing index - send e-mail - continua (next page)