- float spokeAxisTValue = floor(((t + spokePeriod/2) / spokePeriod)) * spokePeriod;
- PVector h1point = axis.getPointAt(t);
- h1point.add(h1.getPhaseNormal());
- h1point = axis.rotatePoint(h1point, (t / helixCoilPeriod) * TWO_PI + h1.getPhase());
- // TODO(shaheen) investigate why h1.getAxis().getPointAt(spokeAxisTValue) doesn't quite
- // have the same value as finding the middle between h1point and h2point.
- PVector spokeCenter = h1.getAxis().getPointAt(spokeAxisTValue);
- PVector spokeVector = PVector.sub(h1point, spokeCenter);
- spokeVector.normalize();
- Line spokeLine = new Line(h1point, spokeVector);
+ int spokeIndex = (int)floor((t - tMin + spokePeriod/2) / spokePeriod);
+ if (spokeIndex < 0 || spokeIndex >= basePairs.length) {
+ return color(0,0,0);
+ }
+ Line spokeLine = basePairs[spokeIndex];