motion capture code