Advertisement

Point to Point Motion

Started by September 25, 2001 05:41 PM
3 comments, last by VermiciousKnid 23 years, 4 months ago
Hey, Is there an easy way or a DirectX function to move a sprite from a certain point x1,y1 to x2,y2 without using trig functions or square roots after every frame? Like in Diablo where you click a point and the character walks in a straight line. What is the most effecient way to accomplish this? VK
Same forum, same page!

"Look around. You might find your answer somewhere."
Advertisement
That thread appears to concern 2D space, not 3D. I''ve been wrestling with a similar problem
and was wondering if anyone was able to get something working with Jesper''s solution?

IcarusXJ
Doh, my apologies. Wrong thread myself. =)

IcarusXJ
Just interpolate between the x, y, and z values. For a constant speed, divide by distance.

This topic is closed to new replies.

Advertisement