I'm not sure I understand what you mean. When you want to change the z-axis of the UI by using the distance to the target do you mean you want to change the z-value or do you actually want to move the z-axis around and change its orientation?
What I actually want to do is the following:
I have a lamp similar to the one below and I want to wrap my marker around it. The UI should appear regardless of the direction from which the IPhone is pointed at the lampshade.
The detection part works. Vuforia is able to detect the target, but because the vuforia z-axis is pointing upwards (see below) and the RealityEditor's z-axis is orthogonal to the display's x-y-plane, the WebUI is rendered onto the top of the lamp and not onto the lampshade. This means when you point the IPhone at the lampshade you see the z-x- or z-y-plane of the WebUI. That's rather flat, because my WebUI doesn't contain any z-information :slightly_smiling:
Maybe it would work if i flipped the z and y axis of my WebUI...
The code part mentioned in my first post still doesn't seem to make sense