Exemplo n.º 1
0
    def quad(self, x1, y1, x2, y2, x3, y3, x4, y4):
        #print("quad inicio")
        self.vertices.append(QVector3D(x1, y1, -0.05))
        self.vertices.append(QVector3D(x2, y2, -0.05))
        self.vertices.append(QVector3D(x4, y4, -0.05))

        self.vertices.append(QVector3D(x3, y3, -0.05))
        self.vertices.append(QVector3D(x4, y4, -0.05))
        self.vertices.append(QVector3D(x2, y2, -0.05))

        n = QVector3D.normal(QVector3D(x2 - x1, y2 - y1, 0.0),
                             QVector3D(x4 - x1, y4 - y1, 0.0))

        for i in range(6):
            self.normals.append(n)

        self.vertices.append(QVector3D(x4, y4, 0.05))
        self.vertices.append(QVector3D(x2, y2, 0.05))
        self.vertices.append(QVector3D(x1, y1, 0.05))

        self.vertices.append(QVector3D(x2, y2, 0.05))
        self.vertices.append(QVector3D(x4, y4, 0.05))
        self.vertices.append(QVector3D(x3, y3, 0.05))

        n = QVector3D.normal(QVector3D(x2 - x4, y2 - y4, 0.0),
                             QVector3D(x1 - x4, y1 - y4, 0.0))

        for i in range(6):
            self.normals.append(n)
Exemplo n.º 2
0
    def quad(self, x1, y1, x2, y2, x3, y3, x4, y4):
        #print("quad inicio")
        self.vertices.append(QVector3D(x1, y1, -0.05))
        self.vertices.append(QVector3D(x2, y2, -0.05))
        self.vertices.append(QVector3D(x4, y4, -0.05))

        self.vertices.append(QVector3D(x3, y3, -0.05))
        self.vertices.append(QVector3D(x4, y4, -0.05))
        self.vertices.append(QVector3D(x2, y2, -0.05))

        n = QVector3D.normal(QVector3D(x2 - x1, y2 - y1, 0.0), QVector3D(x4 - x1, y4 - y1, 0.0))

        for i in range(6):
            self.normals.append(n)

        self.vertices.append(QVector3D(x4, y4, 0.05))
        self.vertices.append(QVector3D(x2, y2, 0.05))
        self.vertices.append(QVector3D(x1, y1, 0.05))

        self.vertices.append(QVector3D(x2, y2, 0.05))
        self.vertices.append(QVector3D(x4, y4, 0.05))
        self.vertices.append(QVector3D(x3, y3, 0.05))

        n = QVector3D.normal(QVector3D(x2 - x4, y2 - y4, 0.0), QVector3D(x1 - x4, y1 - y4, 0.0))

        for i in range(6):
            self.normals.append(n)
Exemplo n.º 3
0
    def extrude(self, x1, y1, x2, y2):
        #print("extrude inicio")
        self.vertices.append(QVector3D(x1, y1, +0.05))
        self.vertices.append(QVector3D(x2, y2, +0.05))
        self.vertices.append(QVector3D(x1, y1, -0.05))

        self.vertices.append(QVector3D(x2, y2, -0.05))
        self.vertices.append(QVector3D(x1, y1, -0.05))
        self.vertices.append(QVector3D(x2, y2, +0.05))

        n = QVector3D.normal(QVector3D(x2 - x1, y2 - y1, 0.0), QVector3D(0.0, 0.0, -0.1))

        for i in range(6):
            self.normals.append(n)
Exemplo n.º 4
0
    def extrude(self, x1, y1, x2, y2):
        #print("extrude inicio")
        self.vertices.append(QVector3D(x1, y1, +0.05))
        self.vertices.append(QVector3D(x2, y2, +0.05))
        self.vertices.append(QVector3D(x1, y1, -0.05))

        self.vertices.append(QVector3D(x2, y2, -0.05))
        self.vertices.append(QVector3D(x1, y1, -0.05))
        self.vertices.append(QVector3D(x2, y2, +0.05))

        n = QVector3D.normal(QVector3D(x2 - x1, y2 - y1, 0.0),
                             QVector3D(0.0, 0.0, -0.1))

        for i in range(6):
            self.normals.append(n)