jupylet/model.py
def q2aa(rotation, deg=False):
    """Transform quaternion to angle+axis."""
    
    if not rotation or rotation == (1., 0., 0., 0.):
        return 0, glm.vec3(0, 0, 1)
    
    c, xs, ys, zs = rotation #glm.conjugate(rotation)

    angle = math.acos(c) * 2
    s = math.sin(angle / 2)

    if deg:
        angle = round(180 * angle / math.pi, 3)
    
    return angle, glm.vec3(xs / s, ys / s, zs / s)
Transform quaternion to angle+axis.
Transform quaternion to angle+axis.
Transform quaternion to angle + axis .
def q2aa(rotation, deg=False):
    if not rotation or rotation == (1., 0., 0., 0.):
        return 0, glm.vec3(0, 0, 1)
    c, xs, ys, zs = rotation 
    angle = math.acos(c) * 2
    s = math.sin(angle / 2)
    if deg:
        angle = round(180 * angle / math.pi, 3)
    return angle, glm.vec3(xs / s, ys / s, zs / s)
def q2aa ( rotation , deg = False ) : if not rotation or rotation == ( 1. , 0. , 0. , 0. ) : return 0 , glm . vec3 ( 0 , 0 , 1 ) c , xs , ys , zs = rotation angle = math . acos ( c ) * 2 s = math . sin ( angle / 2 ) if deg : angle = round ( 180 * angle / math . pi , 3 ) return angle , glm . vec3 ( xs / s , ys / s , zs / s )
Transform quaternion to angle+axis.
Transform quaternion to angle + axis .
"""Transform quaternion to angle+axis.""" #glm.conjugate(rotation)
rotation
deg