• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Spiral Equation

Status
Not open for further replies.
Level 17
Joined
Feb 11, 2011
Messages
1,860
Hello,

Is there an equation of some sorts to determine a spiral path? I need to know how to do this for one of my future spell requests. Basically an object spirals outwards from the caster until it reaches a specific distance. Any ideas?

Thanks,

Mr_Bean
 
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