How can I give a character a joint in his elbow?
In my application, I have a character playing a trombone. I want the user to click and drag his/her mouse and the character's hand snap to the mouse's position. I also want the arm to look like it's moving realistically. How do I go about doing this?
Here's some snapshots. The red dots represent pivot points.
http://www.pauliukonis.com/miscfiles/tromb_arm_1.png
http://www.pauliukonis.com/miscfiles/tromb_arm_2.png
Thanks :)
-Adam
Re: How can I give a character a joint in his elbow?
Reminds of a game called QWOP.
Re: How can I give a character a joint in his elbow?
Inverse Kinematics.
There are some examples on create-games.com
Re: How can I give a character a joint in his elbow?
This interests me also, Hey Quinto I don't suppose you'd be able to put a link to some examples or name a few that you know of. I'd do a search on create-games.com / Daily Click but whenever i try it just doesn't go anywhere (so you can imagine finding specific examples can be like looking for a needle in a hay stack)
Re: How can I give a character a joint in his elbow?
It is not that hard at all, just a simple bit of maths can get it to work.
I am not at a computer with MMF2 at the moment, but I will look into it and post an example in the File Archive of the forum, and send you a PM with the direct link to it.
Re: How can I give a character a joint in his elbow?
Quote:
Originally Posted by Quinto
Inverse Kinematics.
There are some examples on create-games.com
The search engine over there doesn't work. Can you share a link please?
I'm a freelance rigger and do most of my rigging in Lightwave... I was thinking just the other day that it would be great if MMF had a way to create a hierarchy for IK/FK animation. Or even just hierarchy animation itself would be amazingly great for MMF.
Is there a plugin at use that you can mention? Please do tell more.
Re: How can I give a character a joint in his elbow?
Quote:
Originally Posted by Atherton
I don't suppose you'd be able to put a link to some examples or name a few that you know of.
Able i am, but lack of time... ;)
So look about here:
Flexible Arm thingy thread
felxible Arm thingy.mfa
Mech Arm code
Simple Chain thread
Simple Chain.cca (works crazy on MMF2, maybe correct on 1.5)
Verlet Chain Example
Quote:
Originally Posted by PixelatedPict
Is there a plugin at use that you can mention? Please do tell more.
The Phizix object has a example with joints, but i haven't tested it.
Re: How can I give a character a joint in his elbow?
Thanks Quinto for the examples, but I can't figure out how to apply them to my situation (my arm only has two segments). I'll look into them and see if I can figure it out. :)
Izac, thanks for your help on both my threads on this project. It's for a presentation I'm doing in geometry class on sound waves and harmonics in brass instruments.
I tried figuring this out on my own, but all I came up with was a really tough math problem. If any of you can solve this, I'll be practically worshiping you:
http://pauliukonis.com/miscfiles/m.png
Right-click>>View Image to enlarge
AD and DC represent the first and second sections of my arm, respectively. D is my elbow, B is the position of the trombone slide in its first position, and C is its current position (n=XMouse).
TOO CONFUSING!
So can someone either help by describing how to make a pivoting joint or by solving this problem?
Re: How can I give a character a joint in his elbow?
Here is another explanation:
http://www.gotoandplay.it/_articles/2004/12/inverseKinematics.php
It's about kinematics with Flash actionscript, but i think the code can be transferred to mmf.
Look at Download.fla2 on this site, this example has many connected joints which can be moved by mouse.
Re: How can I give a character a joint in his elbow?
I made a Virtual mantis once, and made the arm move this way:
First piece:(Shoulder to elbow)
Shoulder is the center point, elbow is the action point.
then made 32 directions.
Second piece:
(elbow to hand)
elbow is the center point, hand is the action point. then, I made the first piece always be at x, y of toso, and second piece always be at X and Y of first piece. Have a third object (hidden,above the others) with a constant Y, and X is controlled by the mouse.(make it have mouse movement, and set the X and Y accordingly by draggin' the box)
Make the First piece always look at the second, and the second always look at the third...
(hope that made sense!)
I'll look for my mantis thingie to help you out...
Re: How can I give a character a joint in his elbow?
cant the 'sticky object' be used for keeping peices together? Then you calculate the angles with teh Advanced Direction Object i beleive.
Re: How can I give a character a joint in his elbow?
Well, really, all of these work arounds are nice. But what MMF needs is a solid hierarchy system for FK and an IK solver.
I've been thinking about this a lot lately, and, I'm going to make a feature request for this as it should be native in MMF, especially with the impending arrival of flash there will be more people wanting to animation with MMF (I am one of those people).
Re: How can I give a character a joint in his elbow?
Well I got it to work (using a variation of ClickerGuy's method) and it looks decent...but I completely agree with PixelatedPict that this kind of thing would be much appreciated in the next build of MMF. ;)
Thank you everyone for your help and support!