Ejemplo n.º 1
0
    def draw_line_2d_3d(self, x, y, vec, color):
        messageBuilder = self.builder

        RenderMessage.RenderMessageStart(messageBuilder)
        RenderMessage.RenderMessageAddRenderType(messageBuilder, RenderType.DrawLine2D_3D)
        RenderMessage.RenderMessageAddColor(messageBuilder, color)
        RenderMessage.RenderMessageAddStart(messageBuilder, self.__create_vector(x, y))
        RenderMessage.RenderMessageAddEnd(messageBuilder, self.__create_vector(vec))
        message = RenderMessage.RenderMessageEnd(messageBuilder)

        self.render_list.append(message)
        return self
Ejemplo n.º 2
0
    def draw_line_2d(self, x1, y1, x2, y2, color):
        messageBuilder = self.builder

        RenderMessage.RenderMessageStart(messageBuilder)
        RenderMessage.RenderMessageAddRenderType(messageBuilder, RenderType.DrawLine2D)
        RenderMessage.RenderMessageAddColor(messageBuilder, color)
        RenderMessage.RenderMessageAddStart(messageBuilder, self.__create_vector(x1, y1))
        RenderMessage.RenderMessageAddEnd(messageBuilder, self.__create_vector(x2, y2))
        message = RenderMessage.RenderMessageEnd(messageBuilder)

        self.render_list.append(message)
        return self
Ejemplo n.º 3
0
    def draw_line_3d(self, vec1, vec2, color):
        messageBuilder = self.builder

        RenderMessage.RenderMessageStart(messageBuilder)
        RenderMessage.RenderMessageAddRenderType(messageBuilder,
                                                 RenderType.DrawLine3D)
        RenderMessage.RenderMessageAddColor(messageBuilder, color)
        RenderMessage.RenderMessageAddStart(messageBuilder,
                                            self.__create_vector(*vec1))
        RenderMessage.RenderMessageAddEnd(messageBuilder,
                                          self.__create_vector(*vec2))
        message = RenderMessage.RenderMessageEnd(messageBuilder)

        self.render_list.append(message)
        return self
Ejemplo n.º 4
0
    def draw_polyline_3d(self, vectors, color):
        if len(vectors) < 2:
            get_logger("Renderer").error("draw_polyline_3d requires atleast 2 vectors!")
            return self

        messageBuilder = self.builder

        for i in range(0, len(vectors) - 1):
            RenderMessage.RenderMessageStart(messageBuilder)
            RenderMessage.RenderMessageAddRenderType(messageBuilder, RenderType.DrawLine3D)
            RenderMessage.RenderMessageAddColor(messageBuilder, color)
            RenderMessage.RenderMessageAddStart(messageBuilder, self.__create_vector(vectors[i]))
            RenderMessage.RenderMessageAddEnd(messageBuilder, self.__create_vector(vectors[i + 1]))
            message = RenderMessage.RenderMessageEnd(messageBuilder)
            self.render_list.append(message)

        return self