Velocity for circular motion
Posted: Fri Jan 23, 2009 10:27 am
Hi gang,
I want to make a character that moves in a side-scroller fashion, but in a 3D space around a circle. I'm sure there are plenty of ways to do it, and I've been exploring a bunch, but I'm kind of stuck.
I know that what would probably be the simplest way of doing this would be to have an object on the radius of the circle, with a parent at the center of the circle that gets rotated for movement. Indeed I had done this originally but I hadn't done much with it.
Recently I implemented irrNewt physics so that I could mess with it. Don't run away yet -- this isn't an irrNewt specific problem, but a general math problem. I've been scouring google but I can't seem to find a solution which I can follow. My math skills aren't so great, unfortunately.
For those cutting to the chase: What I want is to have a character that moves in a circular manner by means of a user-inputted velocity. In other words, when the user presses the right arrow, the character moves around the circle counter-clockwise. With the left arrow, the character moves clockwise around the circle.
How do I calculate the velocity vector to apply to my character? Any help here would be greatly appreciated, especially some code (or even pseudo-code). Feel free to shame me by showing me how easily it is done with code already posted. I did look with the search function and found some useful stuff, often involving cameras, but I was getting a little lost when trying to calculate the velocity vector in particular (and lost overall, really)
Thanks!
I want to make a character that moves in a side-scroller fashion, but in a 3D space around a circle. I'm sure there are plenty of ways to do it, and I've been exploring a bunch, but I'm kind of stuck.
I know that what would probably be the simplest way of doing this would be to have an object on the radius of the circle, with a parent at the center of the circle that gets rotated for movement. Indeed I had done this originally but I hadn't done much with it.
Recently I implemented irrNewt physics so that I could mess with it. Don't run away yet -- this isn't an irrNewt specific problem, but a general math problem. I've been scouring google but I can't seem to find a solution which I can follow. My math skills aren't so great, unfortunately.
For those cutting to the chase: What I want is to have a character that moves in a circular manner by means of a user-inputted velocity. In other words, when the user presses the right arrow, the character moves around the circle counter-clockwise. With the left arrow, the character moves clockwise around the circle.
How do I calculate the velocity vector to apply to my character? Any help here would be greatly appreciated, especially some code (or even pseudo-code). Feel free to shame me by showing me how easily it is done with code already posted. I did look with the search function and found some useful stuff, often involving cameras, but I was getting a little lost when trying to calculate the velocity vector in particular (and lost overall, really)
Thanks!