From 82ebdaa606e8f81fc8d25c50aed84339236b53fd Mon Sep 17 00:00:00 2001 From: Stan Seibert Date: Mon, 10 Oct 2011 16:49:32 -0400 Subject: Now that solids and channels have separate numbering, we have to map channels back to solid indices to set colors when displaying an event. --- chroma/camera.py | 10 ++++++++-- 1 file 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: -- cgit