How to add constraints to the limbs of the FBX character model driven by IK

I’m trying to add constraints to the limbs of my ik-driven fbx character model, hoping to prevent the model from making anti-human actions. I’m currently trying to use Vector3 to constrain the ik chain, but I don’t know how Vector3 acts on the model. I don’t know much about the constraints. The following are the constraints in my ik chain values:

      leftLeg: {
        target: '左腿控制_L',
        effector: 'mixamorigLeftFoot',
        links: [
            name: 'mixamorigLeftLeg',
            rotationMin: new THREE.Vector3(-Math.PI / 1.2, 0, 0), // 不允许向前弯曲,也不允许围绕Y轴和Z轴的旋转
            rotationMax: new THREE.Vector3(0, 0, 0) // 允许向后弯曲90度,不允许围绕Y轴和Z轴的旋转
            name: 'mixamorigLeftUpLeg',
            rotationMin: new THREE.Vector3(-Math.PI / 1.5, -Math.PI, -Math.PI), // 不允许向前弯曲,也不允许围绕Y轴和Z轴的旋转
            rotationMax: new THREE.Vector3(Math.PI / 1.7, Math.PI, -Math.PI/2) // 允许向后弯曲90度,不允许围绕Y轴和Z轴的旋转

Why do ghosts appear and keep scurrying around when the movement reaches the minimum value?

Huuuuge topic and much more complicated than it sounds like you’re thinking.
There isn’t really built in threejs support for IK and rolling your own is really complicated.
Something along the lines of this level of complexity: GitHub - sketchpunklabs/ossos: Webbased Character Animation System

Thanks for your reply, it gave me an idea

1 Like