transforms an array of 2d coords into 4d

def convert_vec2_to_vec4(scale, data):
    """transforms an array of 2d coords into 4d"""
    it = iter(data)
    while True:
        yield next(it) * scale  # x
        yield next(it) * scale  # y
        yield 0.0       # z
        yield 1.0