[Closed] maxScript – procedural Spider
Very cool, I’d imagine that you do a test with the circles on the feet to see when it hits it’s radius and then put a new step… what I wonder is how do you drive the animation, from the beginpoint to the new position.
-Johan
Eek, yeah something like that I can understand, but how would he lift his leg and place it at a new position, or is it just linear halfway the new position put the Z up so many units? It’s not I don’t understand finding the position, more the make the walking look natural. How do you interpolate between start and end, and make a convincing step.
-Johan
Yeah, Eek is right.
I´m using the master helper´s direction to drive the legs. So if the master is moving in 10 units in [1,0,0] the leg will move 10 units too in the same direction but I´m checking if its passing the max radius, without that the IK will pop. So, if the spider is moving too fast I have to speedUp the leg too to avoid the “pop”
Ex: I set up a predefined variable called masterTime = 10 , then I check if the legs are still inside the radius 10 frames after, if it so, Allright, everything is ok and the spider leg can move to the new position that will be [10,0,0] if not, I have to decrease the masterTime by -1 for example and try the leg again.
For the leg lift theres no mistery, JHN is right. I´m moving the leg Up in the stride middle time some units in the local Z axys, so it´s always up. you can use a predetermined value or a percentage of the travel distance.
I did a different calculation. Each frame I check if the IK is still has the distance (radius) to the circle, if distance was beyond the radius I animate the IK using the direction vector * the radius + position of the circle to place it at the other end of the circle minus a small distance. While the IK is in the air I flip a switch telling not calculate the foot on ground (with shooting a ray) position. So that way I can always say each step is 10 frames. But thinking about it now, maybe your approach is better, because you’re using velocity to drive the speed of the placement, I’m using preset values (each step is exactly 7 frames for example)… hmm fun stuff
-Johan
For the real time one that I did, again in Max 1 or 2, some where around that time frame, I used the expression controller only. I had each IK solver following a path that was the shape of the arc and step of the leg. The speed around that path was driven by the movement forward of the spider. Worked well except turning corners didn’t work well as the feet would slip.
I have actualy played directly with a similar method that Fabio is using. I used the circle on the round as an area as well to step within. I based where there step was going to be placed by the direction that circle was moving in on the last frame and worked out a point on the other side of the circle to place the foot.
I also had issues in my original tests with to many legs in the air at one time but was going to work in tests and decide if I should keep a leg on the ground longer or not. At this point it wasn’t going to be real time any more as you would be getting circular dependancies as each foot would have to know what all the other feet were doing. Maybe doing it in some sort of order could get around that, so the rear leg would check what the middle leg was doing and the middle would check what the front leg was doing. So the front would always be doing it the same.
I tried almost the same method. I also added another arc for the left-right movement. Making it possible to crab-like movement and rotate it to some degree. after 90 degrees since it couldnt tell which way is front, all animation will be reversed.
I’d use a soft ik method, and just check if its reached its softIk length, then move it in the direction of the master. What would be interesting would be to work out gait length and stride distance relative to the velocity so as it got faster it would change from a walk to a run. But with arachnids i think there in constant trot (same time as on ground as in air)
As to checking whether other feet are on the ground i dont think you need to – you just need to define a velocity of walking and running and interpolate as need be.
http://www.youtube.com/watch?v=NMh5sRXqHq8 – this is neat
Ok, so inspired by this thread I’m trying to do something similar and have most of it working for 1 leg I can easily extend it to more, but I’m interrested in how you do the sequencing of multiple legs.
You have some sort of shift register, or just place the legs on there respective ofsets and hop efor the best.
@Eek, I do think some checking should happen, if the spider is turning some legs would stay longer on the ground because they’re the pivots, so that would probably get them out of sync, with lot’s of turning I think it will become a mess. But I have no proof ot that
Any thoughts, or should I just go on and offset the start positions of the legs?
Great thread!
-Johan