https://github.com/hamolicious/inversekinematics
Inverse Kinematics implementation in Python and PyGame
https://github.com/hamolicious/inversekinematics
inverse-kinematics numpy pygame python
Last synced: 5 months 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 (about 4 years ago)
- Default Branch: master
- Last Pushed: 2021-08-07T16:01:00.000Z (almost 4 years ago)
- Last Synced: 2025-01-07T05:26:05.337Z (6 months 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
# 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)
```