@name Nodegrapher
@inputs 
@outputs Nodes:table
@persist 
@trigger 
Nodes=table()
Scale=100
S=0.5
Size=vec(S,S,S)
Z=entity():pos():z()+50
for(C=1,3){
    CS=toString(C)
    for(D=1,3){
        Pos=vec(C*Scale,D*Scale,Z)
        holoCreate(C+D,Pos,Size)
        Nodes[CS,vector]=Pos
    }    
}
Vec1=array()
Vec3=array()
#1
Vec1:pushVector4(vec4(2,5,4,0))
Vec3:pushVector4(vec4(0,0,0,0))
#2
Vec1:pushVector4(vec4(1,5,6,3))
Vec3:pushVector4(vec4(4,0,0,0))
#3
Vec1:pushVector4(vec4(2,5,6,0))
Vec3:pushVector4(vec4(0,0,0,0))
#4
Vec1:pushVector4(vec4(7,8,5,2))
Vec3:pushVector4(vec4(1,0,0,0))
#5
Vec1:pushVector4(vec4(1,2,3,4))
Vec3:pushVector4(vec4(6,7,8,9))
#6
Vec1:pushVector4(vec4(3,2,5,8))
Vec3:pushVector4(vec4(9,0,0,0))
#7
Vec1:pushVector4(vec4(8,5,4,0))
Vec3:pushVector4(vec4(0,0,0,0))
#8
Vec1:pushVector4(vec4(7,4,5,6))
Vec3:pushVector4(vec4(9,0,0,0))
#9
Vec1:pushVector4(vec4(8,5,6,0))
Vec3:pushVector4(vec4(0,0,0,0))



for(C=1,9){
V1=Vec1[C,vector4]
V3=Vec3[C,vector4]
CS=toString(C)
    if(V1:x()){D1=round(Nodes[CS,vector]:distance(Nodes[toString(V1:x()),vector]))}
    if(V1:y()){D2=round(Nodes[CS,vector]:distance(Nodes[toString(V1:y()),vector]))}
    if(V1:z()){D3=round(Nodes[CS,vector]:distance(Nodes[toString(V1:z()),vector]))}
    if(V1:w()){D4=round(Nodes[CS,vector]:distance(Nodes[toString(V1:w()),vector]))}
    V2=vec4(D1,D2,D3,D4)    
    if(V3:x()){D5=round(Nodes[CS,vector]:distance(Nodes[toString(V3:x()),vector]))}
    if(V3:y()){D6=round(Nodes[CS,vector]:distance(Nodes[toString(V3:y()),vector]))}
    if(V3:z()){D7=round(Nodes[CS,vector]:distance(Nodes[toString(V3:z()),vector]))}
    if(V3:w()){D8=round(Nodes[CS,vector]:distance(Nodes[toString(V3:w()),vector]))}
    V4=vec4(D5,D6,D7,D8)
    Nodes[CS,matrix4]=matrix4(V1,V2,V3,V4)
}
fileWrite("nodegraph__"+map()+".txt",glonEncode(Nodes))
