diff options
author | Stan Seibert <stan@mtrr.org> | 2011-10-10 16:49:32 -0400 |
---|---|---|
committer | Stan Seibert <stan@mtrr.org> | 2011-10-10 16:49:32 -0400 |
commit | 82ebdaa606e8f81fc8d25c50aed84339236b53fd (patch) | |
tree | 6d8b7c0ac059ec673de6a44030759b23eeb6f70c | |
parent | d1dd3e5a2b9567c6acb3ee19a88457110a6f4a3f (diff) | |
download | chroma-82ebdaa606e8f81fc8d25c50aed84339236b53fd.tar.gz chroma-82ebdaa606e8f81fc8d25c50aed84339236b53fd.tar.bz2 chroma-82ebdaa606e8f81fc8d25c50aed84339236b53fd.zip |
Now that solids and channels have separate numbering, we have to map channels back to solid indices to set colors when displaying an event.
-rw-r--r-- | chroma/camera.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/chroma/camera.py b/chroma/camera.py index 74ac4ad..302bc6f 100644 --- a/chroma/camera.py +++ b/chroma/camera.py @@ -706,8 +706,14 @@ class EventViewer(Camera): q = self.ev.channels.q # Important: Compute range only with HIT channels - solid_colors = map_to_color(q, range=(q[hit].min(),q[hit].max())) - self.gpu_geometry.color_solids(hit, solid_colors) + channel_color = map_to_color(q, range=(q[hit].min(),q[hit].max())) + solid_hit = np.zeros(len(self.geometry.mesh.triangles), dtype=np.bool) + solid_color = np.zeros(len(self.geometry.mesh.triangles), dtype=np.uint32) + + solid_hit[self.geometry.channel_index_to_solid_id] = hit + solid_color[self.geometry.channel_index_to_solid_id] = channel_color + + self.gpu_geometry.color_solids(solid_hit, solid_color) def process_event(self, event): if event.type == KEYDOWN: |