HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

PolygonalInterpolation Function?

01-22-2006, 10:42 PM#1
BlinkBoy
i have been looking for a function like this around the files in most of the wc3 webs, does anyone know if this function exists and where could i find it out?

PS: do not confuse it with Linear Interpolation.
01-23-2006, 12:34 AM#2
Shisho
Why?
01-23-2006, 02:20 AM#3
BlinkBoy
oh well if u insist, i need it to make a hero use an spell that makes him move in a curve trajectory to an area, so it asamble waves, so instead of using linear trajectories i use curve trajectories.

plus that function may help alot introducing NURMS into wc3.
01-23-2006, 04:51 AM#4
Naakaloh
If I'm understanding correctly, you want a unit to move in a path that would resemble a missile with an arc, except as if you were drawing it on paper and not as if you were throwing it in the air. Well, since as far as I know there's no way to simply order the unit to move in a curved path, you would have to do it as a series of different movements. Assuming you've studied some physics or math those points should probably be pretty easy to figure out, although there are some things that would depend on how you want to move it, like if time or distance it takes to be constant or variable. If you keep time constant then, the curve will be longer and shorter along different axes depending on the distance, if you let it be variable, then you'll probably want the initial angle to be constant so the curve will always have the same shape but it will be larger the farther away the final point is.

Something semi-circular would be easier than elliptical. I think it would be something like: given the position of the unit, the target position, the speed of the unit, and a number of points along the curve the unit has to move (the more you have the more curve-like the movement becomes), you can determine the radius of the circle, then the amount that the angle has to change between each step and how far the unit has to move at each step, then just move it that distance in the new direction. Assuming you keep track of correctly so that it all leads to the final point, it should work and it would give you something curved.

If you understand the math, triggering it shouldn't be an issue. You would setup a timer or a trigger that registers the units arrival at each new position so that you can move it in the next step.

Sorry I couldn't give you anything more specific, but I don't really have the time and I'm not exactly sure what you want.
01-23-2006, 01:38 PM#5
Vexorian
the curve is horizontal (xy) or vertical (z) ?

Well it is obviously possible either way but I 'd want to know how exactly it should be done
01-23-2006, 10:18 PM#6
Naakaloh
Well, its the same, two dimensional movement, you just need to change the axes so that it moves only on the same plane as the ground instead of moving in the air. So instead of messing with unit flying height (Z), just unit X and Y positions.
01-23-2006, 10:20 PM#7
Vexorian
yeah duh, I was asking so I know what to code in and I didn't understand what exactly he wanted to do
01-23-2006, 10:25 PM#8
Naakaloh
Oh, sorry, I misunderstood. I actually was wondering the same thing.
01-23-2006, 11:34 PM#9
BlinkBoy
no, it uses x,y,z as vexorian said, and it will use parabolic movements not med-circular, either elliptical, The best example of what i'm looking are NURMS in 3DSMAX.

Quote:
Originally Posted by Vexorian
I know what to code

u don't have too if u want, i'll try coding it myself, even thought i first need to make a cubic root function for a friend.

thank you both for your help
01-23-2006, 11:45 PM#10
Vexorian
cubic root in JASS ?

Pow(27,1.0/3) returns 3