| 07-22-2009, 08:15 PM | #1 |
So I took moyack's parabola formula JASS:function ParabolicMovement takes real h, real d, real x returns real local real a = -4*h/(d*d) local real b = 4*h/d return a*x*x + b*x endfunction but since I'm not that good with math, what value should be the x? is it supposed to be a value which updates inside a loop? I really don't know because he mentioned the value should not be lesser than zero and not be greater than the distance. Thanks in advance! |
| 07-22-2009, 08:50 PM | #2 |
Perhaps this will help. The value that the function returns is basically the y value of the graph of a parabolic equation at the given x coordinate. |
| 07-22-2009, 08:56 PM | #3 |
d should be the max distance (the distance between the starting and landing point), h the max height (the top of the parabola) and x the current position of the unit. so if you want to move sth in a parabola you need to do sth like this in a loop JASS:dist = dist + speed x = startx + (dist * Cos(angle)) y = starty + (dist * Sin(angle)) z = ParabolicMovement( maxheight, maxdist, dist) |
| 07-22-2009, 08:58 PM | #4 |
ah now I understand. Thank you both cookies |
| 07-23-2009, 01:08 PM | #5 |
Creating the parabola with a given maximum height is badass. If you can't find a script but want to create the parabola this way, drop me a message. |
