Jump to content

  • Log In with Google      Sign In   
  • Create Account


How to apply constant angular speed to quadratic linear speed?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 pTymN   Members   -  Reputation: 452

Like
0Likes
Like

Posted 10 March 2014 - 06:26 PM

If I have a Px(t) = At^3 + Bt^2 + Ct + 0 and Py(t) = 0 for my character's position while running and a constant radians/second that my character can turn, how can I transform that into an explicit formula for Px(t) and Py(t) after turning is applied? Is this related to fresnel and euler spirals or track transition curves? Much thanks to anyone who can give me a strong kick in the right direction.

Edit: I figured out a piece, that I ought to be figuring out P''x(t) and P''y(t) instead of thinking about curves at all.


Edited by pTymN, 10 March 2014 - 09:37 PM.

 


Sponsor:

#2 LorenzoGatti   Crossbones+   -  Reputation: 2611

Like
0Likes
Like

Posted 11 March 2014 - 03:13 AM

If "Px(t) = At^3 + Bt^2 + Ct + 0" is a spline giving position and t is time, maybe you want to trivially follow exactly the same path and turn the character as he goes. 

If you want something else, like walking more or less in the direction the character is facing, you need to figure out how the new motion with turning is supposed to be related to the old motion without turning.

 

For example, if the non-turning character position P(t) goes from P1 to P2 in T seconds with undefined facing and the turning speed is w radians/second, you might want to interpolate between the original P(t) and the circular arc A(t) = A0+ A1*(cos (s+w*t), sin (s+w*t)). A0,  A1, starting angle s and likely angular velocity w can be chosen to match endpoints P1 and P2, tangents, or something else.

 

Or you might want to compute the tangent direction of P(t), let's call it D(t) (an angle, not a vector!), and check that its rate of change doesn't exceed a certain range [-w,w], This would require reconstructing P(t) from its tangent direction at each t value, which also requires arbitrary arc lengths at each t value; clothoid splines are an easy choice for that (constant arc length) but you might prefer something more related to the original cubic spline you try to reproduce.


Produci, consuma, crepa

#3 pTymN   Members   -  Reputation: 452

Like
0Likes
Like

Posted 11 March 2014 - 07:49 AM

I think that I have the basis for a solution. I needed to convert from my turn speed to the curvature, the curvature to a circle radius, and finally the circle radius to acceleration towards the center of that circle.


 


#4 ferrous   Members   -  Reputation: 1837

Like
0Likes
Like

Posted 12 March 2014 - 02:17 PM

I don't exactly know what you're attempting to do, it does look like you're doing a spline, but you may want to look into Dubin's Curves instead to see if that would help you or not.  (It might not)






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS