Exemple #1
0
def testMSMSParser():
    from Pmv.msmsParser import MSMSParser
    msmsParser = MSMSParser()
    msmsParser.parse("./gc2.vert", "./gc2.face")

    msmsParser.parse("./test_0.vert", "./test_0.face")
    from DejaVu import Viewer
    vi = Viewer()

    from DejaVu.IndexedPolygons import IndexedPolygons
    visrf = IndexedPolygons('test', protected=True)
    visrf.Set(vertices=msmsParser.vertices,
              faces=msmsParser.faces,
              vnormals=msmsParser.normals,
              tagModified=False)

    vi.AddObject(visrf)
Exemple #2
0
        GL.glColor4fv(colxf)
        GL.glBegin(GL.GL_LINE_STRIP)
        for i in range(self.nsegments + 1):
            GL.glVertex3fv(self.v[i])

        GL.glEnd()

        GL.glPopMatrix()


if __name__ == '__main__':
    from DejaVu.Arcs3D import Arcs3D, Fan3D
    c = Arcs3D('arc3d',
               vertices=((0, 0, 0), (5., 0., 0.)),
               vnormals=((1.0, 0, 0), (0, 1., 0)),
               materials=((1, 0, 0), (0, 0, 1)),
               radii=(1.0, 2.0),
               angles=(360., 180.))

    f = Fan3D('fan3d',
              vertices=((0, 0, 0), (5., 0., 0.)),
              vnormals=((0, 0, 1), (0, 1., 0)),
              materials=((1, 0, 0), (0, 0, 1)),
              radii=(1.0, 2.0),
              angles=(60., 170.),
              vectors=((1, 1, 0), (1, 0, 0)))
    from DejaVu import Viewer
    vi = Viewer()
    vi.AddObject(c)
    vi.AddObject(f)