From 25ba82258e88e0732a65d0ae2e3725f19f00c4b2 Mon Sep 17 00:00:00 2001 From: Prabhu Ramachandran Date: Fri, 6 May 2011 08:59:56 +0530 Subject: [PATCH] Explicitly creating the pipeline and using a glyph instead of vectors to avoid silly problems with the visualization of scalars as glyphs. --- source/pysph/tools/mayavi_viewer.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/source/pysph/tools/mayavi_viewer.py b/source/pysph/tools/mayavi_viewer.py index ad8a3dd..ade126d 100644 --- a/source/pysph/tools/mayavi_viewer.py +++ b/source/pysph/tools/mayavi_viewer.py @@ -106,12 +106,11 @@ def _particle_array_changed(self, pa): x, y, z, u, v, w = pa.x, pa.y, pa.z, pa.u, pa.v, pa.w s = getattr(pa, self.scalar) p = self.plot + mlab = self.scene.mlab if p is None: - p = self.scene.mlab.quiver3d(x, y, z, u, v, w, scalars=s, - mode='point', - scale_mode='none') - p.glyph.color_mode = 'color_by_scalar' - p.glyph.glyph_source.glyph_position = 'center' + src = mlab.pipeline.vector_scatter(x, y, z, u, v, w, + scalars=s) + p = mlab.pipeline.glyph(src, mode='point', scale_mode='none') p.actor.property.point_size = 3 p.mlab_source.dataset.point_data.scalars.name = self.scalar scm = p.module_manager.scalar_lut_manager