tag:support.nodebox.net,2012-11-01:/discussions/nodebox-2-3/5759-animating-a-lineNodeBox: Discussion 2017-08-17T03:49:18Ztag:support.nodebox.net,2012-11-01:Comment/404751072016-08-05T05:33:33Z2016-08-05T05:33:33ZAnimating a line<div><p>Hi Rory,</p>
<p>I figured out how to do this on a previous project.</p>
<p>The trick is to first Resample (I resample by length for
consistent results), convert to a list of points, sort those
points, then slice and reconnect. Sorting by x coordinate fixes the
random resampling weirdness that occurs with some shapes and works
well for west-to-east arcs; reverse the sort to fly the other
direction.</p>
<p>I am attaching a demo network that draws the entire arc in gray,
reveals a percentage of that arc in black, and also shows a marker
moving along the arc. The Reveal subnetwork reveals a percentage of
the arc using the above method. The Trace subnetwork provides the
marker position; it uses a similar technique except that it returns
a "point on path". You can either combine all three, or use the
Reveal or Trace subnetworks independently.</p>
<p>You control the animation by changing the value of the number
node from 0 to 100 - just feed in a frame node to create an MP4.
Both subnetworks take a path as input; I used a random quadratic
curve.</p>
<p>Also attaching screenshots of the overall network plus the
Reveal subnetwork.</p>
<p>Hope that helps!</p>
<p>John</p>
<p>NOTE: For some reason I am unable to attach the NodeBox network
file. I've tried everything I can think of without success. So
here, in desperation, is the actual text of the NodeBox file.
Please copy paste it into a text editor and save the resulting file
with a .ndbx extension. NodeBox should be able to open it. Please
reply and tell me if this worked:</p>
<p><?xml version="1.0" encoding="UTF-8" standalone="no"?><br>
<br></p></div>johntag:support.nodebox.net,2012-11-01:Comment/404751072016-08-08T03:27:33Z2016-08-08T03:27:33ZAnimating a line<div><p>Frederik suggested attaching a zip of the ndbx file. Let's see
it that works...</p></div>johntag:support.nodebox.net,2012-11-01:Comment/404751072016-08-10T14:54:18Z2016-08-10T14:54:20ZAnimating a line<div><p>HAHAH, this is totally brilliant!</p>
<p>I am going to enjoy playing with this, I may revert with some
questions as I reverse engineer this. thank yoU!</p></div>Rory Creedontag:support.nodebox.net,2012-11-01:Comment/404751072017-08-17T03:49:14Z2017-08-17T03:49:17ZAnimating a line<div><p>Nice feature! I like it :-)</p></div>andy.treichler