# Lifting an arm - and hpr. Newbie

Hello,

I am very new to panda3d. I am using a model (littlebrother) that I downloaded from the Panda site.

I am trying to move the right arm up. The joint I am trying to control is the LeftElbow

I try to rotate it using

`` self.elbow.hprInterval(0.7,Vec3(0,0,90)).start() ``

but what happens is that it not only rotates, but it gets translated as well and I end up with an elbow separated from the upper arm.

How can I rotate a joint “in place” so it does not change its position, only angles?

thank you!
Francisco.

I think you’d have to rotate it relative to the joint where the elbow is attached to, for example:

`` self.elbow.hprInterval(0.7,Vec3(0,0,90),other=self.shoulder).start()``

Hi,
THanks for the help, but it didn’t work. I got a funny rotation around some other axis (presumably the shoulder) but that is not what I want. I want the elbow to rotate in place (basically around it’s own coordinates)
I tried

``self.elbow.hprInterval(.7,Vec3(0,0,180),other=self.elbow).start()``

but that doesn’t work as it apparently recalculates the elbow position at every frame.

Any other ideas?
Thanks for the help.

Every node rotates about its origin–the (0, 0, 0) point of the node. If you want the arm to rotate about its shoulder, it’s up to you to arrange it so that its shoulder is at the (0, 0, 0) point.

Since you didn’t create the model, that’s a little bit harder. But you can do this by introducing a dummy node. Say you figure out that the point inside that shoulder that you want the elbow to rotate around happens to be the point (1.2, 0.5, 3.5). The trick is to create a new node for which that point is (0, 0, 0):

``````self.dummy = self.model.attachNewNode('dummy')
self.dummy.setPos(1.2, 0.5, 3.5)
self.elbow.wrtReparentTo(self.dummy)``````

Now you can do this:

``self.dummy.hprInterval(.7,Vec3(0,0,180)).start()``

David