Giter Site home page Giter Site logo

Comments (4)

miquelcampos avatar miquelcampos commented on September 7, 2024

From @Lohult on August 8, 2018 5:29

This problem can perhaps be fixed if the way the foot connects to the leg is setup in a way that it has a control that when rotated only affects the foot but when translated affects both ik effector and foot.

from shifter_classic_components.

miquelcampos avatar miquelcampos commented on September 7, 2024

Hi @Lohult I will check this since I also have another bug in this component:
#4

Thanks for the feedback :)

from shifter_classic_components.

miquelcampos avatar miquelcampos commented on September 7, 2024

I moving this to the other repository https://github.com/mgear-dev/shifter_classic_components/issues/

from shifter_classic_components.

miquelcampos avatar miquelcampos commented on September 7, 2024

Review the component with the feedback from the forum

http://forum.mgear-framework.com/t/hind-legs-for-quadraped-dont-align-with-guides-created/1698/4

Aerys code

import pymel.core as pm
from mgear.core.transform import getChainTransform2

# Pick joint chains
jnts = [pm.PyNode("jnt" + str(i)) for i in range(4)]
helperJnts = [pm.PyNode("helperJnt" + str(i)) for i in range(3)]

# Read world space xforms and positions
jnt_xform = [j.getMatrix(ws=1) for j in jnts]
Jn = [j.translate for j in jnt_xform]
L = sum([(Jn[i + 1] - Jn[i]).length() for i in range(3)])

# Compute ja and Jfull
ja = (Jn[1] - Jn[0])
ja.normalize()
Jfull = Jn[3] - Jn[0]

# Main formula
A = (Jfull * Jfull - L * L) / (2 * (ja * Jfull - L))

# Construct helper joint chain
hj1_pos = [Jn[0], Jn[0] + ja * A, Jn[3]]
hj1_norm = pm.dt.cross(Jn[1] - Jn[0], Jn[2] - Jn[1])
hj_xform = getChainTransform2(hj1_pos, hj1_norm)

helperJnts[0].setMatrix(hj_xform[0], ws=1)
helperJnts[1].setMatrix(hj_xform[1], ws=1)
helperJnts[2].setMatrix(hj_xform[2], ws=1)

image

from shifter_classic_components.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.