[Closed] Performing a translation ini local space via wiring
I’m currently setting up a facial rig control system and I have a ‘Tongue’ control which drives the rotation of my two tongue bones and I also have a ‘Tnogue_Out’ control which will allow me to move the tongue in and out. This is all connected via wiring. I am hitting a bit of a roadblock now though probably due to my rusty math! When I try to connect the Tongue_Out control to the Y position of my tongue bone (which is a child of the Jaw), the tongue translates in the local space of the Jaw rather than the tongue – is there some funky math I need to be doing to figure out the angles etc and transfer this onto the tongue? (This problem is particularly noticeable when the tongue is pointing to the side and up…)
Objects always transform in the space of their parents. Just make sure that the object has a parent that is aligned to it.
or create an intermiediery point to act as a parent. The math to get the transform space relative to another space is:
(a.transform * inverse b.transform) * c.transform
Great thanks for the replies guys. I thought about doing what you suggested Paul and adding a new parent aligned to the bone, but unfortunately I can’t add extra stuff into the hierarchy (or would really prefer not to as we are rapidly approaching our bone limit for our game exporter!).
Eek, can you explain for me in your example, what a, b and c are?
Well i dont know about wireparameters using transform spaces – but in max you get get the space of an object relative to another by using this formula:
baseObject.transform * inverse targetObject.transform
Then this transform ‘tm’ can be transformed about any new or existing transform, most cases its the target, but can be other objects. In simple terms it could be described and an addition math:
baseObject = 10
targetObject = 20
10 + -20 = -10 – this is you space you base object exists within. Adding -10 back to 20 = 10. You inital value. The key is getting the relative space of your object – I use script controllers for nearly every piece of rigging nowadays – only wire params for quick hacks or simple rigging.
What im guessing your’ll need to do is build a transform ‘tm’ and transform your tougue about that relative to the jaw – something like that.
What Eek suggests would be the method that you would have to use except you will have to use script controllers and not wires. Wires only allow one input so it will not work. Also you can’t really reference it self in the script controller so you might just get an error there as well. If a script were to be setting the transforms of the object then it would work. Why can’t you add any more objects in the hierarchy? Real time application? If so is there no way for the exporter to cull nodes and recalculate the hierarchy? Or could you run a script that would do that by tracking the transform per-frame and store the values, delete the extra node and then apply the transform values back to the object?