Animation Problem

Blitz3D Forums/Blitz3D Beginners Area/Animation Problem

PoliteProgrammer(Posted 2006) [#1]
Hi All.
I'm in the process of trying to animate a character model using Blitz.

At a very simple level, i'm going to parent the lower leg to the knee joint, and then turn the knee joint, etc.


  For i = 73 To 84
    EntityParent GetChild(myModel, i), GetChild(myModel, 72)
  Next



I tried parenting every child to a single pivot. When I did this, random sections of the model were moved (I presume to the origin, which my model is not at.)

Any advice, or possible causes?

Edit: and I have another problem below:


PoliteProgrammer(Posted 2006) [#2]
Code fixed, but there is still a problem.

The turning motion about the knee causes the knee to rotate too. By this, I mean that the knee rotates about some unspecified pivot not at the same position as the knee.
The leg seems to be pivoted to somewhere near the foot. I've checked and entity 72 is DEFINITELY the knee.

What's going on?

Restatement of my problem in case it was confusing:

Via my above code, I've parented all child entities below the knee to the knee. Unfortunately, when i turn the knee: TurnEntity GetChild(myModel, 72), 1, 0, 0
the entire knee and below rotate around the foot.

Could the foot be automatically acting as a pivot?
If so, shouldn't resetting the entityparent prevent this?


timmport(Posted 2006) [#3]
I dont know how you have your situation set up but what I do is seperate out the character model into seperate files. Then in each file I translate the geomtry part so that the joints are at the origin of the scene. When I want to put the parts together in blitz I parent the parts this way:

top_arm=LoadMesh("top_arm.b3d")

fore_arm=LoadMesh("fore_arm.b3d",top_arm)

note that I rerfer to top_arm as the parent as I load the fore_arm.b3d model

Then via blitz code I translate the fore_arm to the correct position relative to top_arm. As the top arm is parent to the forearm and postioned corectly when I rotate the fore_arm it will rotate at the elbow.