• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Spiral Equation

Status
Not open for further replies.
Level 9
Joined
Jul 10, 2011
Messages
562
please make an archimedean spiral ^^

like this one
300px-Archimedean_spiral.svg.png
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Each interval, increase offset, increase angle.
That's all there is to it, really.

By increasing offset, you will have a circular shape that gets bigger each interval (your unit will move away from the central object (Caster) per interval, forming spiral movement)

By increasing angle, your unit will have constant motion around central object (Caster).
 
Level 14
Joined
Dec 9, 2006
Messages
1,091
Defskull is correct. Just use a polar offset, increasing the angle around the caster unit, and the offset from the caster unit, at each interval.

Archimedeans spiral uses the equation:

r = a + b * (degrees)

with the next point being (r, degrees).

a is the initial distance of the object at the initial angle. B is simply a value that effects the offset.

So, with that, repeated iterations of:

  • Set RValue = (60.00 + (0.25 x Degrees))
  • Unit - Move dummy_unit instantly to ((Position of Caster <gen>) offset by RValue towards Degrees degrees) facing (Position of Caster <gen>)
  • Set Degrees = (Degrees + 30.00)
Makes a Spiral trajectory! Keep in mind that the 60, the .25, and the +30 to the degrees are all values that I made up to effect the shape of the spiral. You'll have to edit them to fit your needs.

Cheers,
~Asomath
 
Status
Not open for further replies.
Top