renderer/glViewer.py [2689:2726]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    for conn in connMat_adam:
        # x0, y0, z0 is the coordinate of the base point
        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)
        if conn[1]<22:    #body
            glutSolidCone(2, length, 10, 10)
        else:
            glutSolidCone(0.4, 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 [2767:2804]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    for conn in connMat_adam:
        # x0, y0, z0 is the coordinate of the base point
        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)
        if conn[1]<22:    #body
            glutSolidCone(2, length, 10, 10)
        else:
            glutSolidCone(0.4, 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()
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



