Hey there! I'm working on a bit of a game modification, and I'm looking for a little help with some physics-related math. I'm only in my second year of high-school physics, so I'm not completely sure where to go with this question. And sorry if this is in the wrong forum.(adsbygoogle = window.adsbygoogle || []).push({});

Essentially, I'm trying to rotate an object to how the player is looking. To achieve this, I was originally doing a little bit of math to find the angular difference, and just using a damped spring equation to rotate the object back to how I want it fairly smoothly. Quite simple. The only problem with this is that it steadily slows down as it approaches the angle (0,0,0), never quite stopping or reaching the angle, which makes sense for this equation.

Unfortunately, I'd like the object to uniformly accelerate and uniformly decelerate back to (0,0,0). Differing acceleration and deceleration speeds are necessary, as well as a top speed. Since this is a computer, I can only run so many calculations per second, and I can ignore drag and gravity if I so choose. The player may also choose to change the direction in the middle of the trip back to zero, which would, of course, be necessary to take into account. I realize this may seem a bit demanding, but it's really what's necessary to solve this.

The actual game-use of this is to turn an aircraft to where the player is looking. The turning of their view in conjunction with this is already compensated for. However, I'm sure I'll find some other uses for this in the future, so it's quite beneficial.

A real-world analogy of this would be having a car, say, 50 meters away from a line, which can accelerate and decelerate at certain speeds, and having the car evenly accelerate to a point, then decelerate from that point to a full stop. The line may move mid-trip, which would have to be taken into account, and only so many calculations (say 10) can be done per second.

Logically, this should seem easier, but I'm honestly at a bit of a loss as to what equations I should use for this. If this is an impossibility for me/out of my scope, I can always go back to my simpler equations, but I would very much prefer a better solution. I've been looking for a solution to this for a couple weeks now, and I haven't been able to find anything. It's really been quite a learning experience, that's for sure, but I'd like to finally put this problem away. Any help would be very much appreciated.

**Physics Forums | Science Articles, Homework Help, Discussion**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Smooth Movement to (0,0,0)?

**Physics Forums | Science Articles, Homework Help, Discussion**