Viola! Or as I like to say, Walla!
Those are the Ray Lines that I've been looking for (trying to code).
for (i=0; i<=1224; i+=LineSpacing){
var OctoPer = new Point(OctoGon.getPointAt(i));
var TestCircle = new Path.Circle(OctoPer, 5);
TestCircle.strokeColor = 'green';
VectorRay = OctoPer - CP;
As if any of that makes any sense, you'd really have to look at the
base JavaScript inside the HTML for it to make much sense, but that is
the heart of the green TestCircle & VectorRay code.
VectorPath = new Path(CP, CP + VectorRay);
VectorPath.strokeColor = "blue"; }
Now, all I need to do is chop off the ends.
Oh, no! Darn! Darn! Darn!
VectorPath = new Path(CP, CP + VectorRay);
But since, VectorRay = OctoPer - CP;
This reduces to: VectorPath = new Path(CP, CP - CP + VectorRay);
The two CP's cancel out and instead of a Vector Ray (what I wanted and
why I'm doing this) I've just got a line from the Perimeter to the
Center (and I had that back at the fractal pattern).
Oh, well. Back to the drawing board tommorow.
Maybe inspiration will come in the night.
Oh, and in case it's not clear. I want a true ray, because then I
should be able to use that to get the ball to bounce off the walls at
the correct angle (my true goal in all this).
Previous Brett Code Index Next in Series
OctoWars Project
Copyright © 2013 Brett Paufler