View Full Version : Mech Rig
hayes3d 05-03-2009, 05:37 PM Ok, here is my problem and I hope someone out there can give me a hand with it.
Using 3dMax
Rig: Root > Thigh > Shin > Ankle > foot > Toes (in a nutshell how the rig is created)
As you can see the rig is fairly straight forward and would work just fine in a "deformable" mesh. But since this is a mech and the Hip > Thigh > Shin are not lined up vertically, I used point helpers vertically aligned and constrained the Thigh and Shin to.
The Thigh's pivot point is at the U-Joint area, not at the actual Thigh Point Helper.
And so if I move the leg in the Y / Z-Axis everything looks great. It's when I move in the X-Axis the problem occurs as show on the right of the attached image. What I'm wondering is, how do I get the Thigh Point Helper to move up and down when I move the foot on the X-Axis?
I tried creating an additional Point Helper at the u-joint area and then linking the Hip Point Helper to it. Tried several different linking constraints and IK, and I can't seem to make it work.
I'm sure this is something simple that I'm missing, but I'm not sure what it is. Any help is greatly appreciated.
|
|
hayes3d
05-23-2009, 07:02 PM
So I'm going to bump this once to see if anyone has any comments at all on how to do the leg rig for this? I'm sure it has something to do with some sort of offset or something but I'm not sure.
Karnageddon
05-23-2009, 08:20 PM
Its kind of hard to see with the transparency, but from what i can see it seems like the pivots are not accurately centered to each other. Even the slightest pivot difference can cause rotation issues. Is it possible to post your scene? i can try to pinpoint it.
hayes3d
05-23-2009, 08:37 PM
Well the pivots for the ik are all centered. it's the top helper that I am using for the top of the IK that is the issue.
You will see two separate problems in this rig. If you grab the right foot controller and move it on the X axis you will notice the Hip and the Foot look good but the reverse knee is broken. That is because I have a position constraint on the shin to the reverse knee helper.
On the left leg, if you grab the foot controller and move it on the X axis, you will notice that the hip and reverse knee look good, but the foot shin disconnects from the foot.
And the whole problem stems from the hip helper that has the IK bound to it not moving up and down. I dunno what to do.
Karnageddon
05-23-2009, 10:05 PM
Problem fixed
You had a position constraint applied to the Right Thigh. As soon as i removed it, the problem was gone. You probably added it by mistake while trying to add it to Right Calf. It seems to be animating the exact same way as the Left Leg now, hopefully this was your problem and is fixed.
hayes3d
05-23-2009, 10:07 PM
Oh, no I did that to try and solve the problem. And it creates another problem. See by removing the constraint, you will notice the shin going through the foot as you move closer to "0" on the X axis. But if you move out further then it detaches from the foot. So it doesn't fix the problem.
Make sense?
Karnageddon
05-24-2009, 05:12 AM
After messing around with your scene for a while, i realized that what you are trying to control may be physically impossible.
I can get it working 99%. The problem here is the design, its mechanically flawed. I can make it walk, but the problem is that the waist controller causes the foot to rotate as well. The reason is because your calf is cylindrical making it capable of rotating on only 1 axis. This is technically accurate and hence causing your original problem. Everything you had done was right; it was just the design that caused the problem. If you want to keep the feet planted without mesh intersections, you have to use a spherical calf/joint or design a method for your feet to rotate independently from the calves.
To make your mech do a rotation, it will have to be in smaller steps, because the majority of the joints only rotate in 1 direction.
To get a better example of what i mean, perform this awkward task(make sure no one is around, they might ask if you're taking drugs): stand completely still, tighten all the joints in your body body and twist only your torso. With enough force your feet will spin against the ground, towards the direction your torso is facing. Now prevent your feet from spinning and try twisting your torso, you'll notice that the feet wont go anywhere, preventing you from turning, which is exactly what is happening in your scene (with the exception being that your knees are stronger and wont pop out like the mech's). See how difficult it is? You are able to do that much only because your joints are more rounded, adding flexibility.
A spherical joint would give you exactly the result you are aiming for here. A better idea though would be to let the torso rotate independtly from them lower body with the legs attached to it (the way i've seen most mechs) but that will involve redoing most of your mesh unfortunately :(.
I hope this helps you, if you want i can attach the progress.
hayes3d
05-24-2009, 10:45 AM
I would love to see what you have done so far. Yeah I know about the feet and having it cylindrical so it really only has one axis for movement and I had suggested doing a funky-u-joint on the ankle area that I look at for an actual prosthesis for that same area. But it's just for a game mod, so they don't care if it clips a bit for now. But I can always change the design later on. I know it's not 100% accurate in terms of realism but....
And the main torso will rotate independently of the waist controller anyways. All the turning is actually handled by code so no animation needed for that part.
But anyways, yes, I would love to see what you have done so far.
**Added after looking at the feet.
One other thing I wanted to do was to make the cylinder part of the ankle rotate side to side in relation to the shin bone. But I'm not sure if that is possible because that rotation has to be at the bottom of the cylinder where it meets the foot. But when the leg moves forward and back, the rotation has to be in the center of the cylinder so it looks like the attachment point of the shin is rotating around the cylinder, as it currently is if you move the foot in the Y-axis.
Of course if that is not possible, I think I am just going to attach the ankle to the shin and then the rotation will be where the shin+ankle meets the foot.
Not sure if that makes sense or not.
Cactus Dan
05-24-2009, 01:31 PM
Howdy,
Well, I can't look at your file because I don't have 3DS Max, but from the image you posted it looks like you need a setup like this:
http://www.cactus3d.com/OffsetIK.mov
There was a discussion here a while back about this setup:
Offset IK setup discussion (http://forums.cgsociety.org/showthread.php?f=54&t=617908&highlight=Cactus+Dan)
The original poster in that thread is using Maya, and even though I use Cinema 4D with my own character rigging plugins, I was able to explain the setup enough so that he could get a working solution in Maya. ;)
I hope that helps.
Adios,
Cactus Dan
hayes3d
05-24-2009, 02:57 PM
Cactus Dan > That is exactly what I am looking for, going to go and read the thread now. Thanks!
**Ack!
it's all in another package. So now I have to figure it out as I haven't used Maya in years so trying to translate this into 3dmax. Any thoughts on how to do that? I'm creating just the rig itself with bones like you have done to mirror your work but I don't totally understand it. I will post my findings here though and any questions I might have.
Cactus Dan
05-24-2009, 04:40 PM
Howdy,
Well, the whole idea behind the setup is to try to keep a squared up rectangle between the hip and the IK handle:
http://www.cactus3d.com/SquareTarget.jpg
To do that I used aim constraints, which sort of works, but I'm thinking it would work better using a bit of trigonometry in an expression.
Adios,
Cactus Dan
hayes3d
05-24-2009, 05:39 PM
After looking at it some more, I figured out what I needed to do. At least I think so. I did this test first, and it seemed to work and then I applied it to my mech rig. I haven't completed a full rom test on it as of yet as I have to go run some errands.
But I attached image.
Cactus Dan
05-24-2009, 06:27 PM
Howdy,
Yeah, it looks like you've got the gist of it. ;)
Adios,
Cactus Dan
Karnageddon
05-24-2009, 08:13 PM
Great to see you got it worked out. Here's what i was able to get, as requested.
The changes i made were to the Right leg so you can compare them to the left, they are as follows.
These will prevent the leg from separating and intersecting when animated
-Bip01 R Calf > Remove Position/Orientation Constraints
-Bip01 R Calf > Linked to > Bip01 R Thigh
-Bip01 R Foot > Linked to > Bip01 R Calf
These properly constraint the feet to the ground
-Bip01 R Foot > Orientation Constraint>R_foot_CNT
These create primary lift using the toes (your attribute controller can assist this as a secondary lift animation)
-Bip01 R Toe1> Orientation Constraint >R_foot_CNT>Weight 0
-Bip01 R Toe0> Orientation Constraint >R_foot_CNT>Weight 0
The 0 weight acts as a secondary link, the weight wont be carried over towards the position, but the toes bending will always be facing the ground as a result.
You can always remove this if you want full control over the animation.
I hope i didn't miss any steps there.
hayes3d
05-29-2009, 01:35 PM
Karnageddon, I could not open your file. Different version of Max maybe? I'm using Max 2008.
Well I uploaded a new file. Everything is really close. Feet stay planted, hip rotates side to side correctly with offset. Only problem is the hip "slides" around a bit? Even though it's linked to the hip point helper. Not sure what is happening there? Wondering if anyone can take a look at it.
When you open up the file, zoom into the hip joint area (u-joint) and you will notice that as you move the foot around, the u-joint is all over the place. And I can't seem to get the bone for the u-joint that is on the waist to correctly wire to the expose transform on the thigh. Any thoughts on that as well?
Cactus Dan
05-29-2009, 03:03 PM
Howdy,
Well, I can't open the file (I don't have Max), so I'm not sure what's happening.
But to rig a universal joint, I usually use 2 aim constraints with up vectors on the objects, with the object's pivot points placed at the center of the cross on the u-joint. The 2 aim constraints have individual target objects at 90º to each other, but they share a common up vector object:
http://www.cactus3d.com/U_JointSetup.jpg
The setup works like this:
http://www.cactus3d.com/UniversalJoint.mov
Looking at the original image of your model, I'd set the u-joint rig up where the up vector object was a stationary part of the body, so that the 2 aim constraint's up vectors point to the body, and have the hip joint's rotation controlling the u-joint's rotation.
I hope that helps.
Adios,
Cactus Dan
hayes3d
05-29-2009, 03:20 PM
Haha Karnageddon. Very true.
Yeah I was going to try around my lunch break to do what Dan was talking about. Not sure if I 100% follow until I actually try it. Before I tried this offset rig, I had the u-joints working perfectly so that the x-rotation was wired to expose transform on the thigh point helper. And it worked beautifully. Not so much now... It doesn't even rotate at the same speed as the point helper on the thigh now...Not sure what is going on. Thanks for taking a look at this.
Karnageddon
05-29-2009, 03:21 PM
I think we'll all be in the grave before max gets backwards compatibility.
I'll take a look at the new file you posted and see if I can fix it using Dan's method.
Cactus Dan
05-29-2009, 03:38 PM
Howdy,
I just quickly merged the 2 files together so you could see how it works:
http://www.cactus3d.com/U_Joint_Hip.mov
I find the aim constraint to be indispensable when it comes to mechanical rigging. ;)
Adios,
Cactus Dan
hayes3d
05-29-2009, 06:32 PM
Cactus Dan, that is exactly what I want my leg to act like, but it doesn't want to :-P. Going to work on it this weekend though and figure it out.
CGTalk Moderation
05-29-2009, 06:32 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.