################
# > Randomness: An a strange and pretty swirling hologram.
# > How to use: Spawn it and gaze in awe.
################

@name Randomness
@persist Loop Add Sin

Scale=vec(3,3,3)
Model="hqtorus2"

interval(100)

if (first()|duped()) {
    holoCreate(1)
    holoPos(1,entity():pos()+vec(0,0,Scale:z()*6))
    holoScale(1,Scale)
    holoModel(1,Model)
    for (Loop=2,50) {
        holoCreate(Loop)
        holoPos(Loop,holoEntity(Loop-1):pos()+vec(0,0,Scale:z()*1))
        holoScale(Loop,Scale)
        holoModel(Loop,Model)
    }
}

Add+=10
Sin=sin(Add)

for (Loop=1,50) {
    holoAng(Loop,ang(Sin*Loop,Sin*Loop,Sin*Loop)*5)
    holoColor(Loop,hsv2rgb(vec(Add%(Sin*Loop)*Loop/7,1,1)))
}
