renderer/glViewer.py [2881:2914]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        x0 = joints[3*conn[0]]
        y0 = joints[3*conn[0]+1]
        z0 = joints[3*conn[0]+2]
        # x1, y1, z1 is the vector points from the base to the target
        x1 = joints[3*conn[1]] - x0
        y1 = joints[3*conn[1]+1] - y0
        z1 = joints[3*conn[1]+2] - z0

        length = math.sqrt(x1*x1 + y1*y1 + z1*z1)
        theta = math.degrees(math.acos(z1/length))
        phi = math.degrees(math.atan2(y1, x1))

        glPushMatrix()
        glTranslate(x0, y0, z0)
        glRotatef(phi, 0, 0, 1)
        glRotatef(theta, 0, 1, 0)
        glutSolidCone(skelSize, length, 10, 10)

        glPopMatrix()

    #Spine to ground projection
    conn = [0,1]
    x0 = joints[3*conn[0]]
    y0 = joints[3*conn[0]+1]
    z0 = joints[3*conn[0]+2]
    # x1, y1, z1 is the vector points from the base to the target
    x1 = joints[3*conn[1]]
    y1 = joints[3*conn[1]+1]
    z1 = joints[3*conn[1]+2]

    glBegin(GL_LINES)
    glVertex3f(x0, y0, z0)
    glVertex3f(x1, y1, z1)
    glEnd()
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



renderer/glViewer.py [2940:2973]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        x0 = joints[3*conn[0]]
        y0 = joints[3*conn[0]+1]
        z0 = joints[3*conn[0]+2]
        # x1, y1, z1 is the vector points from the base to the target
        x1 = joints[3*conn[1]] - x0
        y1 = joints[3*conn[1]+1] - y0
        z1 = joints[3*conn[1]+2] - z0

        length = math.sqrt(x1*x1 + y1*y1 + z1*z1)
        theta = math.degrees(math.acos(z1/length))
        phi = math.degrees(math.atan2(y1, x1))

        glPushMatrix()
        glTranslate(x0, y0, z0)
        glRotatef(phi, 0, 0, 1)
        glRotatef(theta, 0, 1, 0)
        glutSolidCone(skelSize, length, 10, 10)

        glPopMatrix()

    #Spine to ground projection
    conn = [0,1]
    x0 = joints[3*conn[0]]
    y0 = joints[3*conn[0]+1]
    z0 = joints[3*conn[0]+2]
    # x1, y1, z1 is the vector points from the base to the target
    x1 = joints[3*conn[1]]
    y1 = joints[3*conn[1]+1]
    z1 = joints[3*conn[1]+2]

    glBegin(GL_LINES)
    glVertex3f(x0, y0, z0)
    glVertex3f(x1, y1, z1)
    glEnd()
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



