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

[Feature Request] Inverse Kinematics & Position Transforms #8

Open
Bug-Reaper opened this issue Oct 8, 2020 · 9 comments
Open

[Feature Request] Inverse Kinematics & Position Transforms #8

Bug-Reaper opened this issue Oct 8, 2020 · 9 comments
Labels
enhancement New feature or request

Comments

@Bug-Reaper
Copy link

I'd be down for helping with a PR for this but I wanted gauge your interest in adding these features?

Love how clean and well put together this repo is. Definitely the best react/three I've seen 👍

@ritz078
Copy link
Owner

ritz078 commented Oct 8, 2020

I'd be down for helping with a PR for this but I wanted gauge your interest in adding these features?

Definitely. How do you plan to integrate it into the UI? Do you have anything in mind ?

Love how clean and well put together this repo is. Definitely the best react/three I've seen

Thanks a lot for your kind words. ❤️

@ritz078 ritz078 added the enhancement New feature or request label Oct 8, 2020
@Bug-Reaper
Copy link
Author

Definitely. How do you plan to integrate it into the UI? Do you have anything in mind ?

For sure man, I'm not really married to any of these ideas but this is how I'd approach it.

So you already have a pretty good implementation of the rotational transform controller. I think I'd add a radio style toggle on the left sidebar right beneath the gender select. This radio style toggle would have the options "Rotation", "Position", and "Scale" and these could be buttons with text or sensible icons. When "rotation" is selected, the app would essentially work the same as it does now. When "position" or "scale" is selected, the app would work very similar to how it does now except we'd swap in the corresponding "position"/"scale" transformation controller instead of the "rotation" controller. Sensible hotkeys for switching between the helpers is probably good if we take this approach.

Somethings I'd consider off the top of my head would be:

  1. Possibly allow for any subset of rotation/position/scale controllers to be visible/usable at the same time. I know this would work with something like rotation+position controllers but the scale+position controllers might conflict, would need some testing and also we'd probably want to play around with the controller sizing to make it work as good as possible.
  2. If you have something selected already with one of the controllers, when you change to a different controller that thing should remain selected.
  3. Example of the THREE position/rotation/scale controller. Documentation of the THREE position/rotation/scale controller.

As for the inverse kinematics I need to do more due diligence here. I'd like to examine any closed/open source implementations of reverse kinematics and relevant UI, particularly any 3D UI. Then draw from the best of all worlds as much as possible.

@ritz078
Copy link
Owner

ritz078 commented Oct 8, 2020

I have one question.

When "position" or "scale" is selected, the app would work very similar to how it does now except we'd swap in the corresponding "position"/"scale" transformation controller instead of the "rotation" controller.

The reason I did not implement position and scale was that I felt it won't help if we want to transform body parts. In theory if I move the hand, it will be detached from the body unless we find a way to keep the joints intact and make sure the hand is not stretched.

Scale can work if we want to bulk up the body. But should we instead use a slider that controls the muscles instead of scaling individual body parts if that's our use case?

As for the inverse kinematics I need to do more due diligence here. I'd like to examine any closed/open source implementations of reverse kinematics and relevant UI, particularly any 3D UI. Then draw from the best of all worlds as much as possible.

👍🏼 Sounds good

@Bug-Reaper
Copy link
Author

Bug-Reaper commented Oct 22, 2020

Makes sense! I think it'd be cool to scale the size of certain body parts individually or in groups as you describe. Floating body parts could also be cool but probably not on by default.

Going to be playing around a bit with:
https://github.com/jsantell/THREE.IK
https://jsantell.github.io/THREE.IK/

Not sure if it's an exact fit for what's needed here but hopefully I can learn about how one actually programs iterative inverse kinematics.

@ritz078
Copy link
Owner

ritz078 commented Oct 22, 2020

https://jsantell.github.io/THREE.IK/examples/#multi-effector looks exactly like the one we might have to implement.

@ritz078
Copy link
Owner

ritz078 commented Oct 22, 2020

Thank you for introducing me to this. It looks like this can solve a lot of problems we have right now.

@Bug-Reaper
Copy link
Author

My AI friends tell me the FABRIK method for inverse kinematics is famous, so it should be pretty battle tested for our needs here.

There's another repo from around the same time that implements the same thing, possibly more fully featured in terms of constraints:
https://github.com/lo-th/fullik
http://lo-th.github.io/fullik/#3D_demo_0

It looks less documented, but their example is in THREE so it's definitely also compatible. Gonna peek into the source code for both [:eye:]

@ritz078
Copy link
Owner

ritz078 commented Nov 10, 2020

@Bug-Reaper Are you working on this ? If not, I can take this over.

@Bug-Reaper
Copy link
Author

Unfortunately, I won't have time to dive into this for another week at least. Just been swamped with some work projects behind schedule. If you're down to take a stab, go for it! You certainly won't be stepping on my toes 👍 @ritz078

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

No branches or pull requests

2 participants