PDA

View Full Version : Weird behavior of on-the-fly objects


tokola
07-10-2015, 08:15 AM
I am using a piece of code from Vizard's onTheFly.py example (see below) to create some dots on a map. The dots are created normally when run from within the module ('__main__'), but become square when the module is called from another module (see images)! Absolutely nothing changes in the way the code is called, so it makes no sense to me why this might happen. Seems like a bug.
def DisplayClickedCoords(self,coords):
#Add on-th-fly points on the map for all the coordinates
viz.startLayer(viz.POINTS)
viz.pointSize(20)
viz.vertexColor(viz.RED)
self.spots = viz.endLayer()
self.spots.disable(viz.CULLING)
for c in coords:
self.spots.addVertex(c[0], 0, c[1])
self.spots.alpha(0.5)
I can try and reproduce the problem in a sample script, but before I do this, is there any reason that you think such a behavior can be explained?

farshizzo
07-10-2015, 09:09 AM
Is one script enabling multisampling and the other not? Without multsampling enabled, points will usually be rendered as squares.

tokola
07-10-2015, 10:05 AM
Easy fix! I knew it would be a piece of cake for you, farshizzo!

I have a hard one coming in another thread, soon:)