Wow! Works like a charm
Thank you so much for taking the time to look into the issue and helping me out 
I have a small follow up question - the scene is oriented as if the marker was laying down on the floor (z-axis up), in which case this outcome would be correct. Any idea on how would I go about setting things up correctly for a marker placed on a wall?
I’ve tried to fiddle around with the code, but the matrix operations are giving me a hard time 
