Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hamolicious/inversekinematics
Inverse Kinematics implementation in Python and PyGame
https://github.com/hamolicious/inversekinematics
inverse-kinematics numpy pygame python
Last synced: 6 days ago
JSON representation
Inverse Kinematics implementation in Python and PyGame
- Host: GitHub
- URL: https://github.com/hamolicious/inversekinematics
- Owner: hamolicious
- License: wtfpl
- Created: 2021-07-04T17:42:43.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-08-07T16:01:00.000Z (over 3 years ago)
- Last Synced: 2023-03-10T16:38:03.285Z (over 1 year ago)
- Topics: inverse-kinematics, numpy, pygame, python
- Language: Python
- Homepage:
- Size: 1.87 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## InverseKinematics
Inverse Kinematics implementation in Python and PyGame![screenshot](https://github.com/hamolicious/InverseKinematics/blob/master/screenshots/screen_recording.gif?raw=true)
# Usage
```python
# import object from ik.py
from ik import InverseKinematicsActor2D, Constraints
# create an inverse kinematics object
arm = InverseKinematicsActor2D(pos=(300, 300), limb_lengths=[100, 100, 100])
# add constraints to limbs
arm[0].bones[0].constraint = lambda angle : Constraints.clamp(250, 350, angle)
# updating the object re-calculates limb orientations
arm.update()
# pass in a pygame `Surface` object to be drawn to
arm.display(screen)
```