Video
This is a project about experiment on Inverse Kinematic
Algorithm
Projection from 3d to 2d
To animate a character with inverse kinematics (IK), start with the hip as the origin and define face and up vectors to create a plane representing the character's orientation. Project bone positions and the target onto this plane. Solve IK for joint angles within the plane. Finally, use the plane's normal vector as the axis of rotation for realistic character movement and orientation adjustments.
Oval Generator
Idea from this videoIn order to make the limbs looks like walking, we utilize x and y coordinates to create an oval trajectory. This trajectory is defined by the following equations:
-
x = origin.x + step_length * cos(freq * t)
-
y = origin.y + step_length * sin(freq * t)
Key points to understand:
- x and y Coordinates: These equations describe the robot's position in terms of its x and y coordinates.
-
Origin: The variables
origin.x
andorigin.y
represent the starting point of the trajectory. -
Step Length:
step_length
determines the length of each step the robot takes. -
Frequency: The parameter
freq
controls the frequency of the motion, affecting the shape of the oval. -
Time Offset: You can add an
offset
to the time variablet
to shift the motion of the robot's left and right legs, allowing for more dynamic movements.
Demo
This is walking with no constrain with target weight 50, regular weight 0, 200, 100
Walking with wall constrain
Climbing slope
Failed attemps
walking on spline surface
I tried to make the character walk on the surface but it doesnt take in the y value of the surface and decend
Rotation of character
Rotation doesnt do well and makes it looks like doing chinese kungfu
Weight magnitude
I have tried different magnitude, right now I stay with target at 50, and regular at 0, 500, 200, target too high will cause the leg to twist frequently
3d IK
I didnt figure out how to calculate T, R and RP for 3d position, so I went with the projection method
Reference
Human walk - Inverse KinematicsThank you!
I sincerely recommend fellow student to avoid IK project when choosing your finals, it's like I bullied my brain