Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A Problem in The Constraint Solver #17

Open
Atiehmerikh opened this issue Apr 22, 2020 · 4 comments
Open

A Problem in The Constraint Solver #17

Atiehmerikh opened this issue Apr 22, 2020 · 4 comments

Comments

@Atiehmerikh
Copy link

Atiehmerikh commented Apr 22, 2020

In forward or backward phase of FABRIK algorithm, it should be check that the target is not out of the ellipsoidal shape according to the paper you mentioned:
Aristidou, A., & Lasenby, J. (2011). FABRIK: a fast, iterative solver for the inverse kinematics problem. Graphical Models, 73(5), 243-260.

But in your code, you're just checking the angle between two vectors and rotating the vector that relates to the target.
I think this is not the correct way that FABRIK solves it. The algorithm should check the position of the target according to an ellipsoidal shape, as explained in the paper.

@Atiehmerikh Atiehmerikh changed the title Constraint solver The problem in Constraint Solver Apr 22, 2020
@Atiehmerikh Atiehmerikh changed the title The problem in Constraint Solver A Problem in Constraint Solver Apr 22, 2020
@Atiehmerikh Atiehmerikh changed the title A Problem in Constraint Solver A Problem in The Constraint Solver Apr 22, 2020
@alansley
Copy link
Collaborator

Hi there.

Yes, you're correct I do just "check the angle" - which acts as a circular 'limiting-gate' rather than an ellipsoidal one. The problem at the moment is that storing the bones as two points does not provide enough information to generate a consistent rotation matrix - so a createRotationMatrix() method is used (in the Mat3f class) to do as best it can.

To resolve this issue bone directions would either need to be stored in quaternions or each bone would require its own rotation matrix which would keep everything consistent and allow for checking the 'quarters' of the ellipsoidal shape.

I don't have the time to perform these modifications, but as the library is open source you are of course welcome to submit your own solution to the issue.

@Atiehmerikh
Copy link
Author

Atiehmerikh commented May 18, 2020 via email

@alansley
Copy link
Collaborator

alansley commented May 21, 2020

The reference axis of a hinge joint is a vector in the plane of the hinge about which clockwise and anti-clockwise constraint angles are measured. So if you've got a vector, like think of a pencil standing point upwards on a desk, then the surface of the desk describes the hinge rotation axis - then, a reference axis is like placing a second pencil pointing (for example) directly towards you. The hinge constraint angles (clockwise and anti-clockwise) are relative to the reference angle (i.e. the pencil pointing towards you). Hope that makes sense...

Reference axes must be within the plane of the hinge rotation axis. For example, if you take a look at the setHinge() method of FabrikJoint3D you'll notice that if a reference axis does not fall within the plane of the rotation axis (as determined by the fact that the dot-product of the two vectors is zero [or very close to zero if we're being picky], i.e. they're perpendicular) then the method throws an exception.

Global hinges have the hinge plane (e.g. the plane which is perpendicular to a given vector) specified in world-space, while for local hinges the hinge plane is in the local space of the previous bone in the chain (which is to say, it's in the coordinate system as generated by the Mat3f.createRotationMatrix() method ).

Take a look at 3D Demo 5 / Figure 20 of the documentation for an example of global hinges with reference constraints, and 3D Demos 6 and 7 for local hinges with reference constraints.

Cheers! =D

@Atiehmerikh
Copy link
Author

Atiehmerikh commented May 27, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants