Ok,I got an actor moving along a nurbs curve using the method you suggested. It looks something like this:
curve = rope.node().getCurve()
point = Vec3()
tang = Vec3()
angle = atan2(tang.getY(),tang.getX())
LerpFunctionInterval.__init__(self,updateModelPos,duration = duration,fromData = result.getStartT(), toData = result.getEndT())
I quickly noticed that the actor’s motion is not uniform along the curve. That is, it’s fast in someplaces and slow in others (mainly around bends).
I think this has something to do w/how the NURBS equations work. So then I tried to decompose the curve into linear segments so I can control the rate of travel of the actor (and make it uniform). I came up w/this.
def getPoints(self, len):
"""Returns a list of len points, evenly distributed in
parametric space on the rope, in the coordinate space of the
curve = self.rope.node().getCurve()
result = curve.evaluate(render)
numPts = len
ropePts = 
print "CURVE START T: "+str(result.getStartT())
print "CURVE END T: "+str(result.getEndT())
for i in range(numPts):
pt = Point3()
#print "evaluating t: "+str(i / float(numPts - 1))
result.evalPoint(i / float(numPts - 1), pt)
grandularity = 100
self.rope = rope
dur = float(duration)/float(grandularity)
seq = 
for ptId in range(len(points)-1):
#print "Creating interval: "+str(points[ptId])+" "+str(points[ptId+1])
print 'created: ' +str(len(seq))+' lerp intervals '
No dice here either. It seems to be a little better, but still basically the same issue. I think what I need is to somehow capture the arc length of the curve between two points and use that to make uniform lerp intrevals.
Anyways, I’m sure someone has done this before so any hints or suggestions would be useful.