# Lerp interval to get previous starting position

Hi there, I have a problem. I want to use a LerpHprInterval to rotate a node (and its attached objects as a consequence) by 90º, and then I want the starting Hpr to be 90º so that it can rotate further in 90º into 180º in a loop. Here is the incomplete code:

``````def rotateTargets(self):

# Create Lerp intervals for each target orbit node to rotate all of the targets
# in a sequence with easing
self.rotateTargets = Sequence(Parallel(
LerpHprInterval(self.orbitNodes["orbit0"], 4, Point3(0, 0, 90), blendType = "easeInOut"),
LerpHprInterval(self.orbitNodes["orbit1"], 4, Point3(0, 90, 0), blendType = "easeInOut"),
LerpHprInterval(self.orbitNodes["orbit2"], 4, Point3(0, 0, -90), blendType = "easeInOut"),
...
name = "rotateTargets"))
self.rotateTargets.loop()``````

Any help? I’ve read the manual as far as to include:

``startHpr=self.orbitNodes["orbit0"].getHpr()``

but I guess all this does is save the starting value of the first iteration of the loop, and transfer it to the second…

Here’s some trial and error with functions passed as Rotation values to dynamically change them. I print them to the console, and indeed I get: 180, 270, 360, etc., but the animation is not affected…

``````def rotateTargets(self):

# Create Lerp intervals for each target orbit node to rotate all of the targets
# in a parallel sequence with easing
self.angle = 90

self.rotateTargets = Sequence(Parallel(
LerpHprInterval(self.orbitNodes["orbit0"], 4, Point3(0, 0, self.angle),
blendType = "easeInOut", startHpr = Point3(0, 0, self.angle-90)),
name = "rotateTargets0"), Func(self.hprAngle))
self.rotateTargets.loop()

def hprAngle(self):
self.angle += self.orbitNodes["orbit0"].getR()
print self.angle``````

Does it save the same initial value for every iteration of the sequence loop?