def initialize(self): glutPositionWindow(0, 600) GLRealtimeProgram.initialize(self) colors = [(1, 0, 0), (0, 1, 0), (0, 0, 1), (1, 1, 0), (0, 1, 1), (1, 0, 1)] for (i, cloud) in enumerate(self.clouds): point_list = glGenLists(i + 1) self.point_lists.append(point_list) # compile the point cloud glNewList(point_list, GL_COMPILE) glDisable(GL_LIGHTING) glBegin(GL_POINTS) for point in cloud: if len(point) == 2: xyz = point[0] rgb = point[1] else: xyz = point[:3] if len(point) == 4: rgb = point[3] elif len(point) > 4: rgb = point[3:6] else: rgb = None if rgb is not None: glColor3f(*map(lambda x: x / 255.0, rgb)) else: glColor3f(*colors[i % len(colors)]) glVertex3f(*xyz[:3]) glEnd() glEndList() logging.debug("compiled {} points for cloud {}".format(len(cloud), i))
def __init__(self, world, xforms=None, title=None): GLRealtimeProgram.__init__(self, title or "World Visualization") self.world = world self.xforms = xforms or [] self.xforms += [se3.identity()] # configure the rendering self.clippingplanes = (0.1, 100) logger.info("visualization ready")
def __init__(self, clouds, xforms=None, world=None): GLRealtimeProgram.__init__(self, "Cloud Visualization") self.clouds = clouds or [] self.point_lists = [] self.xforms = xforms or [] self.xforms += [se3.identity()] self.world = world self.point_size = 2 # configure the rendering self.clippingplanes = (0.1, 100) logger.info("visualization ready")
def initialize(self): glutPositionWindow(0, 600) GLRealtimeProgram.initialize(self)