Dear Folks,
I have doubts about my coding style
if (buttons&16):
Dist=[]
DistL=[]
#KeyPos in Dictonary abspeichern
# Wenn Entfernung des Neuen Punktes mindestens 20cm von einem Vorhandenen ist
# wird der Neue Punkt in den Dict aufgenommen
for i in range(len(self.KeyPosDic.keys())):
Dist.append(self.PosVec-self.KeyPosDic.values()[i])
DistL.append(Dist[i].length())
DistL.sort()
if len(DistL)==0:
self.KeyPosDic['KeyPos '+str(len(self.KeyPosDic.items()))+' =']=self.PosVec
elif DistL[0] >= 0.2:
self.KeyPosDic['KeyPos '+str(len(self.KeyPosDic.items()))+' =']=self.PosVec
for i in range(len(self.KeyPosDic.keys())):
#print self.KeyPosDic
#KeyPositionModel
self.KeyPosM =loader.loadModel("models/BallSmall")
self.KeyPosM.setShaderInput("texDisable",1,1,1,1)
self.KeyPosM.setPos(self.PosVec)
self.KeyPosM.reparentTo(self.environ)
This could be solved more elegantly but how?
cheers
Martin