Simple concept, though I'm having one heck of a time making this work the way I want to. Basically, I want to curve my lightning bolts (picture below). I've tried using Sin to interpolate between two positions, but that didn't work out so I'm going to ask here.
Basically, I want to create a curve between points A and B. Right now, the bolts are straight-ish lines, like so:

Basically, I want them to curve like this:

This is the code I'm using at the moment:
So what I need help with is figuring out how I can make these bolts arc. I'll probably skim my math book in the mean time, but if anyone knows of a sure-fire way to do this I'd be really grateful.
Thanks in advance for any help.
Basically, I want to create a curve between points A and B. Right now, the bolts are straight-ish lines, like so:

Basically, I want them to curve like this:

This is the code I'm using at the moment:
Function Strike(X#,Y#,Z#,TX#,TY#,TZ#,Amount) SetEmitterLifeSpan 0,Rand(10,20) DX# = TX-X DY# = TY-Y DZ# = TZ-Z For N# = 0 To Amount From# = 1.0-Sin((N/Float(Amount))*90) If N = Amount Or N = 0 Then SetEmitterColorFrom 0,0,0,0,0 SetEmitterColorTo 0,0,0,0,0 Else SetEmitterColorFrom 0,220,255,255,1 SetEmitterColorTo 0,220,255,255,1 EndIf SetEmitterPosition gLightning,X+DX*From,Y+DY*From,Z+DZ*From CreateParticle gLightning Next End Function
So what I need help with is figuring out how I can make these bolts arc. I'll probably skim my math book in the mean time, but if anyone knows of a sure-fire way to do this I'd be really grateful.
Thanks in advance for any help.
