POV-Ray : Newsgroups : povray.binaries.animations : A spline based animation with active stipples : Re: A spline based animation with active stipples Server Time: 20 Jun 2019 19:19:05 GMT
  Re: A spline based animation with active stipples  
From: Jeff Reifel
Date: 4 Mar 2014 05:50:00
Bald Eagle <cre### [at] netscapenet> wrote:
> Holy cow!  That is REALLY COOL!
> Any hints on how you achieved that effect?

StippleGen available at:
http://www.evilmadscientist.com/2012/stipplegen-weighted-voronoi-stippling-and-tsp-paths-in-processing/
can generate stipple diagrams from images. StippleGen saves its files as
editable SVG files. It can also generate a TSP path from the stippled image, and
save that path as an SVG file which can be edited into POV-ray spline syntax.

Thousands of object{ANT}s are placed at integer indexed locations along the
spline with a #while loop and moved by adding the clock value to the index
causing them to follow each other.
 The following code places,points and moves the objects along the spline.
////////////////////////////////////////////////////////////////////
#declare ArraySize= [THE NUMBER OF POINTS IN YOUR SPLINE];
#declare SP=spline{natural_spline
[YOUR SPLINE]}
#declare Step=1 ;
#declare I=0;
union{
#while(I<ArraySize-1)
#declare C=clock;
#declare Xf = SP(I+.002+C*Step).x; //Where it's headed
#declare Yf = SP(I+.002+C*Step).y; //Where it's headed
#declare Xo = SP(I+C*Step).x;//Where it coming from
#declare Yo = SP(I+C*Step).y;//Where it coming from
#declare Xv  = Xf-Xo;//x component of vector
#declare Yv =  Yf-Yo; //y component of vector
 #if(Yv=0)
 #declare Yv=.001;
  #end
#declare RA=0;
#if  (Yv<0)
#if  (Xv<0)
 #declare RA=-180+atan(Xv/Yv);
  #else
    #declare RA=180+(atan (Xv/Yv));
    #end
     #end
   #declare Point =-(180/pi)*atan(Xv/Yv)-RA; // direction of motion
                                             //keeps object moving head first.

object{ANT
 rotate <0,0,Point>//points object
 translate<Xo,Yo,0>//moves object
    }
#declare I=I+Step ;#end  }


Post a reply to this message

Copyright 2003-2008 Persistence of Vision Raytracer Pty. Ltd.