mrdoob / three.js

JavaScript 3D Library.
https://threejs.org/
MIT License
102.38k stars 35.35k forks source link

CCD IK solver not honoring the joint limits #25331

Closed JorgeVilchis closed 1 year ago

JorgeVilchis commented 1 year ago

Description

Setting limits for the joints for the CCD IK solver configuration does not seem to have effect.

Reproduction steps

  1. Set the limits using the rotationMIN and rotationMAX inside the array passed to the CCD IK solver.
  2. The joints do not move in the desired range, some of the them rotate only from 0 to PI / 2 all the time.
  3. The first link seems the one affected.

Code

// code goes here
 { index: 2  , limitation : new THREE.Vector3( 0, 1, 0 ) , rotationMin: new THREE.Vector3( 0, -1.6056 , 0), rotationMax: new THREE.Vector3( 0, 1.6056,0  )  },
                 { index: 1  , limitation : new THREE.Vector3( 0, 0, 1 ) , rotationMin: new THREE.Vector3( 0, 0, -1.6056 ), rotationMax: new THREE.Vector3( 0, 0, 1.6056 )  }  

Live example

Not available since I just run the code locally. :(

Screenshots

No response

Version

r147

Device

Desktop

Browser

Chrome

OS

Linux

Mugen87 commented 1 year ago

Not available since I just run the code locally. :(

I don't understand how this prevents you from sharing a live example 🤔 .

mrdoob commented 1 year ago

Closing until @JorgeVilchis figures out how to share a live example.

JorgeVilchis commented 1 year ago

Would an animated GIF be ok ?

Mugen87 commented 1 year ago

No. The purpose of a live example is to have the opportunity to read and debug your code.

LeviPesin commented 1 year ago

@JorgeVilchis Why you can't use JSFiddle?

JorgeVilchis commented 1 year ago

ok, I will upload my code to JSFiddle.