Tuesday, June 8, 2021

Back to the walk cycle!

I need to go back to working on the peep walk cycle. Right now it's actually a ‘step’ cycle, as the peep takes a single long or short step with one foot and then moves the other foot (just ignore facing for the moment and be okay with the peep walking backwards 8-). Start by finding the farthest foot from the destination, create a ‘move’ vector and reduce it to 10 px. The feet are now farther apart than they were and if the other foot is too far away, move it closer to the other. If the feet are too close together, move them apart. Now, check the distance between the feet and the destination again and move the farthest, do all the other things, rinse and repeat while at least one foot is not at zero distance, on the destination point. So, while both feet are more than zero distance from the destination, move the farthest point 10 px closer to the destination, check to see if the feet are either too close together or too far apart. If they are, move the feet apart or together from the midpoint between the two feet. Then we iterate through the while loop until both feet are not zero distance from the destination.

I got the walk cycle working fairly good now and added a routine to get a new destination every time the peep gets somewhere. So the user can choose a point for the peep to walk to, while the peep is constantly walking to new destinations before and after. That and I need to make a proper mesh, extrude limbs then shape and move them… so, go back to what I was doing before I fixated on the walk cycle, which I had skipped originally because it was frustrating me (sigh). The legs’ll still be shocking rubber-band triangle fans until I work out bones and joints, but not today.

No comments:

Post a Comment