[Math] Curve Path

~GaLs~

† Ғσſ ŧħə ѕαĸε Φƒ ~Ğ䣚~ †
Reaction score
180
pathFormula.PNG


The red dot is my hero.
Blue cross is my dummy.

How do I change my dummy's position according to the black path?
What's the formula to use?
Any snippets around?
 

DrEvil

FCRI Associate!
Reaction score
111
You would need to to have 1 array for dummy's and 1 for angle offset's .

Each tick , you should decrease the distance then increase the angle's :

JASS:
function tick ...
   local data d = GetTimerData(...)
   local integer i = 0 // d.da = dummy angle // d.d = dummy
   loop   // d.distance = dist // d.x/y = caster x/y
      exitwhen i > 4
      set d.da<i> = d.da<i> + 5 // working in degrees here
      call SetUnitX(d.d<i>,d.x+d.distance*Cos(d.da<i>*bj_DEGTORAD))
      call SetUnitY(d.d<i>,d.y+d.distance*Sin(d.da<i>*bj_DEGTORAD))
      set i = i + 1
   endloop
   set d.distance = d.distance - 5
endfunction</i></i></i></i></i></i>


That should make a kind of spiralling circle , though youd need to set d.distance to the max range at first.
And set d.da[0-4] to there respective angles first ( 0 , 72 , 144 , 216 , 288 )
 

~GaLs~

† Ғσſ ŧħə ѕαĸε Φƒ ~Ğ䣚~ †
Reaction score
180
Huh HUh??..
I'm blured.
Maybe some demo map? Please...?

I'm really stupid in mathematic calculations.
 

DrEvil

FCRI Associate!
Reaction score
111
Here :

more spirals = less distance decrease

slower spirals = lower angle increase

( for the above , its vice'versa )

the best model i could find in a suitable time :p
 

Attachments

  • Spiralling Stars.w3x
    21.2 KB · Views: 162
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top