So I'm just gonna say this right now the finale of my film is pretty awesome, I mean it has a unicycle for pete's sake. Of course that means I would have to animate a unicycle. Screw that lets script it.
It's really not that hard once you get down to it.
The first step for both direction and wheel rotation, get a vector of where you are now compared to where you just were.
for wheel rotation take that vector and divide it by the radius of your wheel and you have the amount of rotation in radians, easy.
For direction use atan2 on the vector to get the rotation for the direction. I also check to see if I'm moving backwards from where I was just and then offset the rotation so it doesn't just flip around.
one problem right now is to have auto/manual control I add the change in rotation for both the auto and manual controls to the the current rotation, which is going to cause problems for direction at least when I loop through the animation.
I'll need to add a hard manual mode where the rotations are directly linked to the manual controls. Then I just have to start my animation in that mode so it resets every time it loops
It's really not that hard once you get down to it.
The first step for both direction and wheel rotation, get a vector of where you are now compared to where you just were.
for wheel rotation take that vector and divide it by the radius of your wheel and you have the amount of rotation in radians, easy.
For direction use atan2 on the vector to get the rotation for the direction. I also check to see if I'm moving backwards from where I was just and then offset the rotation so it doesn't just flip around.
one problem right now is to have auto/manual control I add the change in rotation for both the auto and manual controls to the the current rotation, which is going to cause problems for direction at least when I loop through the animation.
I'll need to add a hard manual mode where the rotations are directly linked to the manual controls. Then I just have to start my animation in that mode so it resets every time it loops