SORRY I CANNOT GET THE CODE HTML TO WORK
Hey! So I am creating a 3d visualization of a network based on a spreadsheet. The spreadsheet lists each node of the network with the type of node it is (hence the a, b, and c type in my code). The problem is that I later want to examine the position of each of these nodes so that I can change the model in panda if there exists more than one node of the same type in the same position (trekkin?). This may be more of a python problem, but help would definitely be appreciated. Basically, I want to go back afterwards and see if my 8th iteration (/node) has the same position as my 6th, and if so, stack them or something. Here is the code snippet for this. Pardon if I am a terrible writer.
class MyApp(ShowBase): def __init__(self): ShowBase.__init__(self) #make a model for each node based on type def createmodels(): for i in range(0, len(nodeinfo)): self.atype=self.loader.loadModel("samples/Disco-Lights/models/sphere") self.atype.setColor(1,0,0,0) self.btype=self.loader.loadModel("samples/Disco-Lights/models/sphere") self.btype.setColor(0,0,1,0) self.ctype=self.loader.loadModel("samples/Disco-Lights/models/sphere") self.atype.setColor(0,1,0,0) if nodeinfo[i]=='A': self.atype.reparentTo(self.render) self.atype.setScale(.4,.4,.4) self.atype.setPos(float(nodeinfo[i])*4,float(nodeinfo[i])*4,2) elif nodeinfo[i]=='B': self.btype.reparentTo(self.render) self.btype.setScale(.4,.4,.4) self.btype.setPos(float(nodeinfo[i])*4,float(nodeinfo[i])*4,2) elif nodeinfo[i]=='C': self.ctype.reparentTo(self.render) self.ctype.setScale(.4,.4,.4) self.ctype.setPos(float(nodeinfo[i])*4,float(nodeinfo[i])*4,2)
Mod edit: you had the “Disable BBCode in this post” box ticked.