Lightsaber

Blitz3D Forums/Blitz3D Programming/Lightsaber

If you use sprites (instead of quads) in default mode, they will be aligned to the camera automaticly.

I'd do it this way (assuming your just loaded sword mesh is aligned blade up, grip down)

figure out the top and the bottom location of the blade. then do somthing like this:

n=20
dim s(n)

for i=0 to n
 y=y_bottom+ ((y_top-y_bottom)/n)*i
 s(i)=createsprite()
 positionentity s(i),0,y,0
 scalesprite s(i),0.1,0.1,0.1
 entityparent s(i),sword
next


Use floats, of course.