All Projects → TheComet → Ik

TheComet / Ik

Licence: mit
Minimal Inverse Kinematics library

Programming Languages

c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to Ik

Handeye calib camodocal
Easy to use and accurate hand eye calibration which has been working reliably for years (2016-present) with kinect, kinectv2, rgbd cameras, optical trackers, and several robots including the ur5 and kuka iiwa.
Stars: ✭ 364 (+7.06%)
Mutual labels:  solver, rotation
Mesh mesh align plus
Precisely align, move, and measure+match objects and mesh parts in your 3D scenes.
Stars: ✭ 350 (+2.94%)
Mutual labels:  3d, rotation
Rotate 3d
3D Rotation image along specific axes
Stars: ✭ 81 (-76.18%)
Mutual labels:  3d, rotation
Probreg
Python package for point cloud registration using probabilistic model (Coherent Point Drift, GMMReg, SVR, GMMTree, FilterReg, Bayesian CPD)
Stars: ✭ 306 (-10%)
Mutual labels:  3d
Stuntrally
The main repository containing Stunt Rally sources and game data. A 3D racing game based on VDrift and OGRE with track editor.
Stars: ✭ 314 (-7.65%)
Mutual labels:  3d
React Particles Webgl
🔆 A 2D/3D particle library built on React, Three.js and WebGL
Stars: ✭ 330 (-2.94%)
Mutual labels:  3d
Von Grid
Hexagonal & square tile grid system with three.js
Stars: ✭ 336 (-1.18%)
Mutual labels:  3d
Cardslideview
一行代码实现ViewPager卡片效果,比ViewPager2更强大,底层同样是RecyclerView
Stars: ✭ 301 (-11.47%)
Mutual labels:  3d
Fcgf
Fully Convolutional Geometric Features: Fast and accurate 3D features for registration and correspondence.
Stars: ✭ 328 (-3.53%)
Mutual labels:  3d
Audiofabric
a 3d music visualization
Stars: ✭ 327 (-3.82%)
Mutual labels:  3d
Dota Doai
This repo is the codebase for our team to participate in DOTA related competitions, including rotation and horizontal detection.
Stars: ✭ 326 (-4.12%)
Mutual labels:  rotation
React Postprocessing
📬 postprocessing for react-three-fiber
Stars: ✭ 311 (-8.53%)
Mutual labels:  3d
Osm2world
converter that creates three-dimensional models of the world from OpenStreetMap data
Stars: ✭ 330 (-2.94%)
Mutual labels:  3d
Online3dviewer
Online 3D Model Viewer
Stars: ✭ 312 (-8.24%)
Mutual labels:  3d
Pyamg
Algebraic Multigrid Solvers in Python
Stars: ✭ 335 (-1.47%)
Mutual labels:  solver
React Babylonjs
React for Babylon 3D engine
Stars: ✭ 299 (-12.06%)
Mutual labels:  3d
Limonengine
3D FPS game engine with full dynamic lighting and shadows
Stars: ✭ 331 (-2.65%)
Mutual labels:  3d
Nerdamer
a symbolic math expression evaluator for javascript
Stars: ✭ 322 (-5.29%)
Mutual labels:  solver
Medpy
Medical image processing in Python
Stars: ✭ 321 (-5.59%)
Mutual labels:  3d
Marlin Config
Marlin firmware instant configurator
Stars: ✭ 327 (-3.82%)
Mutual labels:  3d

Inverse Kinematics Library

An implementation of the FABRIK solver. Specialized 2-bone and 1-bone solvers are also included.

See the wiki page for details on how to use it

Building

You can build the project as follows using the default settings:

mkdir build && cd build
cmake ../
make -j8
make install

For a detailed list of all of the build options, see the wiki page On POSIX systems, you can enable malloc()/free() wrappers with -DIK_MEMORY_DEBUGGING=ON and you can further enable memory backtraces with -DIK_MEMORY_BACKTRACE=ON.

Unit tests and benchmarks are also included, those can be enabled with -DIK_TESTS=ON and -DIK_BENCHMARKS=ON, respectively.

Overview

IK (Inverse kinematics) can be useful in many situations ranging from procedural animation to small adjustments of animation. Simply put, IK is used when you want to position the tips of a hierarchichal structure at a known location and need to calculate all of the rotations of the parent joints to achieve this.

Here is an example of foot placement being adjusted according to inclination.

Click to see image

Here is another example of the paw of a dog being placed at a location using IK.

Supported features are

  • Solving arbitrary trees (including disjoint trees) with any number of end effectors.
  • Matching target rotations as well as target positions.
  • Calculation of joint rotations, useful for skinned characters.
  • Specifying chain length for each effector.
  • Conversion between local and global space.
  • Weighted end effectors to facilitate transitioning between the solved and initial transforms.
  • Nlerp of weighted end effectors to make transitioning look more natural.
  • Logging.
  • Dumping trees to DOT format.

Features being worked on are

  • Weighted segments.
  • Joint constraints and constraint callbacks.
  • Bone skipping.
  • Mass/Spring/Damper solver.

All of the code was written in C89 and has no dependencies other than the C standard library. Memory debugging facilities are in place to track memory leaks. On linux, backtraces can be generated to the respective malloc() and free() calls.

Example usage

Here is a minimal working example that probably satisfies your needs.

#include <ik/ik.h>

int main()
{
    /* Create a solver using the FABRIK algorithm */
    struct ik_solver_t* solver = ik.solver.create(IK_FABRIK);

    /* Create a simple 3-bone structure */
    struct ik_node_t* root = solver->node->create(0);
    struct ik_node_t* child1 = solver->node->create_child(1, root);
    struct ik_node_t* child2 = solver->node->create_child(2, child1);
    struct ik_node_t* child3 = solver->node->create_child(3, child2);

    /* Set node positions in local space so they form a straight line in the Y direction*/
    child1->position = ik.vec3.vec3(0, 10, 0);
    child2->position = ik.vec3.vec3(0, 10, 0);
    child3->position = ik.vec3.vec3(0, 10, 0);

    /* Attach an effector at the end */
    struct ik_effector_t* eff = solver->effector->create();
    solver->effector->attach(eff, child3);

    /* set the target position of the effector to be somewhere within range */
    eff->target_position = ik.vec3.vec3(2, -3, 5);

    /* We want to calculate rotations as well as positions */
    solver->flags |= IK_ENABLE_TARGET_ROTATIONS;

    /* Assign our tree to the solver, rebuild data and calculate solution */
    ik.solver.set_tree(solver, root);
    ik.solver.rebuild_data(solver);
    ik.solver.solve(solver);
}

See the wiki page for details on how to use it

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].