• Create Account

## Simple character movement

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.

### #1noatom  Members

919
Like
0Likes
Like

Posted 24 June 2012 - 03:26 AM

The thing is,I'm very bad at math,right now I'm taking some trigonometry lessons from khanacademy.I know how to use cos,sin,tan without any problems,however,I have a big problem.

I can't seem to find a way to make a dot move.

Suppose I have something like this:

I have a dot. W moves the dot forward,A left,D right and S back.

BUT!! The dot's front must always be on the same line with the camera,something like in a 3rd person game!.

At the beginning the dot is at 0,0,0(x,y,z).If I press W,the dot will go on the positive Z axis,so the dot will have 0,0,1.
The same happens with with A,D,S(that go left,right and back).

The problem here is that this is just a linear movement.What happens when I have to take a curve? Or what happens when I the dot won't be on aimed on the z axis anymore?

You probably know what I'm talking about,I want that dot to take real curves,not just linear movement.And for that we need some trigonometry.

So I'm talking about something like a 3rd person game,where you need curves for realistic movement.If someone has any ideea how to make something like this,please explain with details...

### #2molehill mountaineer  Members

595
Like
0Likes
Like

Posted 26 June 2012 - 03:13 AM

I'm not entirely sure if this is what you're looking for but check out bezier and catmull-rom curves. Basically you use an equation to describe the path on which an asset must travel; catmull-rom being handy in that the object passes all points that you used to define the curve. I used it in the past to implement enemy flight paths in a schmup and it worked pretty well.