Exemple #1
0
 def test_gle( self ):
     from OpenGL.GLE import (
         gleSetJoinStyle,
         TUBE_NORM_EDGE, TUBE_JN_ANGLE, TUBE_JN_CAP,
         glePolyCone,
     )
     if (gleSetJoinStyle):
         gleSetJoinStyle(TUBE_NORM_EDGE | TUBE_JN_ANGLE | TUBE_JN_CAP)
         glePolyCone(((-6.0, 6.0, 0.0), (6.0, 6.0, 0.0), (6.0, -6.0, 0.0), (-6.0, -6.0, 0.0), (-6.0, 6.0, 0.0), (6.0, 6.0, 0.0)),
                             ((0.0, 0.0, 0.0), (0.0, 0.8, 0.3), (0.8, 0.3, 0.0), (0.2, 0.3, 0.9), (0.2, 0.8, 0.5), (0.0, 0.0, 0.0)), (1, 1, 3, 0.5, 2, 1))
     else:
         logging.warn("No GLE extrusion library")
Exemple #2
0
def _draw_compass_geometry():
    """
    Do GL state changes and draw constant geometry for compass.
    Doesn't depend on any outside state, so can be compiled
    into an unchanging display list. 
    """
    glEnable(GL_COLOR_MATERIAL)
    glPolygonMode(GL_FRONT_AND_BACK, GL_FILL)
    glDisable(GL_CULL_FACE)
    glColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE)

    #ninad 070122 - parametrized the compass drawing. (also added some doc). 
    #Also reduced the overall size of the compass. 

    p1 = -1 # ? start point of arrow cyl? 
    p2 = 3.25 #end point of the arrow cylindrical portion
    p3 = 2.5 #arrow head start point
    p5 = 4.5 # cone tip

    r1 = 0.2 #cylinder radius 
    r2 =0.2
    r3 = 0.2
    r4 = 0.60 #cone base radius

    glePolyCone([[p1,0,0], [0,0,0], [p2,0,0], [p3,0,0], [_P4,0,0], [p5,0,0]],
                [[0,0,0], [1,0,0], [1,0,0], [.5,0,0], [.5,0,0], [0,0,0]],
                [r1,r2,r3,r4,0,0])

    glePolyCone([[0,p1,0], [0,0,0], [0,p2,0], [0,p3,0], [0,_P4,0], [0,p5,0]],
                [[0,0,0], [0,.9,0], [0,.9,0], [0,.4,0], [0,.4,0], [0,0,0]],
                [r1,r2,r3,r4,0,0])

    glePolyCone([[0,0,p1], [0,0,0], [0,0,p2], [0,0,p3], [0,0,_P4], [0,0,p5]],
                [[0,0,0], [0,0,1], [0,0,1], [0,0,.4], [0,0,.4], [0,0,0]],
                [r1,r2,r3,r4,0,0])

    glEnable(GL_CULL_FACE)
    glDisable(GL_COLOR_MATERIAL)

    return
Exemple #3
0
def _draw_compass_geometry():
    """
    Do GL state changes and draw constant geometry for compass.
    Doesn't depend on any outside state, so can be compiled
    into an unchanging display list. 
    """
    glEnable(GL_COLOR_MATERIAL)
    glPolygonMode(GL_FRONT_AND_BACK, GL_FILL)
    glDisable(GL_CULL_FACE)
    glColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE)

    #ninad 070122 - parametrized the compass drawing. (also added some doc).
    #Also reduced the overall size of the compass.

    p1 = -1  # ? start point of arrow cyl?
    p2 = 3.25  #end point of the arrow cylindrical portion
    p3 = 2.5  #arrow head start point
    p5 = 4.5  # cone tip

    r1 = 0.2  #cylinder radius
    r2 = 0.2
    r3 = 0.2
    r4 = 0.60  #cone base radius

    glePolyCone([[p1, 0, 0], [0, 0, 0], [p2, 0, 0], [p3, 0, 0], [_P4, 0, 0],
                 [p5, 0, 0]], [[0, 0, 0], [1, 0, 0], [1, 0, 0], [.5, 0, 0],
                               [.5, 0, 0], [0, 0, 0]], [r1, r2, r3, r4, 0, 0])

    glePolyCone([[0, p1, 0], [0, 0, 0], [0, p2, 0], [0, p3, 0], [0, _P4, 0],
                 [0, p5, 0]], [[0, 0, 0], [0, .9, 0], [0, .9, 0], [0, .4, 0],
                               [0, .4, 0], [0, 0, 0]], [r1, r2, r3, r4, 0, 0])

    glePolyCone([[0, 0, p1], [0, 0, 0], [0, 0, p2], [0, 0, p3], [0, 0, _P4],
                 [0, 0, p5]], [[0, 0, 0], [0, 0, 1], [0, 0, 1], [0, 0, .4],
                               [0, 0, .4], [0, 0, 0]], [r1, r2, r3, r4, 0, 0])

    glEnable(GL_CULL_FACE)
    glDisable(GL_COLOR_MATERIAL)

    return