spiral drawer lua enhanced

  • asdf123
    14th Sep 2012 Member 0 Permalink

    I edited mnip's, giving a lot more 3dom.

     

    use x to draw, use t to set type of material, use v to set distance between each estion of spira, and use c to set lenght of spiral.

     

    SHD4 is the best element to use. 

    have fun!

    :)

     

    spiralx = 0
    spiraly = 0
    spiralv = 0
    divfac = 15
    splth = 100000

    function tpt.drawspiral(maxspiral,spart)
    spiralv = 0
    for i = 0, maxspiral - 1, 1 do
    if spiralv ~= 360 then
    spiralv = spiralv + 0.1
    elseif spiralv == 360 then
    spiralv = 1
    end

    spiralx = tpt.mousex + spiralv * math.cos(math.rad(spiralv))/divfac
    spiraly = tpt.mousey + spiralv * math.sin(math.rad(spiralv))/divfac
    if spiralx > -1 and spiraly > -1 and spiralx < 612 and spiraly < 384 then tpt.create(spiralx,spiraly,spart) end

    end
    end

    function spiralkeys(key,blank,blank,event)
    if string.upper(key) == "X" and event == 1 then
    tpt.drawspiral(splth,sl)
    elseif string.upper(key) == "T" and event == 1 then
    sl = tpt.input("Spiral Drawing", "Input an element name to proceed")
    elseif string.upper(key) == "V" and event == 1 then
    divfac = tpt.input("Spiral Drawing", "Input a number for sprial wideness")
    elseif string.upper(key) == "C" and event == 1 then
    splth = tpt.input("Spiral Drawing", "Input a number for spiral length") * 100000
    end
    end

    tpt.register_keypress(spiralkeys)

     

  • asdf123
    16th Sep 2012 Member 0 Permalink

    Has anyone tries this yet?

    I want feedback!!!

     

  • mniip
    16th Sep 2012 Developer 0 Permalink
    this is actually useless...
  • shaunyo222
    23rd Sep 2012 Member 0 Permalink

    i think it is cool lol

  • nucular
    21st Oct 2012 Member 0 Permalink

    nice but i've got errors...