By yssoh
on Fri, 09/30/2022 - 12:17
Hello,
I'm working on an AR application using Vuforia engine.
For an arbitrary AR camera position and rotation, I want to determine whether a moving target is visible or off-camera.
And if the target is off-camera, I want to display an arrow on the UI canvas indicating the direction the target is in.
After the image marker is detected, the following values are available.
(1) ARCamera's position and rotation values (6 values)
(2) The target object's position values (3 values)
I noticed that all these values are based on the marker position.
In other words, the "world coordinate system" in this context is the "marker coordinate system".
Now how can I get the target object direction vector?
I think I need to first convert the target object's marker coordinate values to camera coordinate values.
Then, I need to do some calculations to determine if the target is visible or not for a given camera FOV (horizontal/vertical).
I'm not used to handling Unity classes and functions for this kind of matrix calculation.
Could you help me out?
I have attached two images showing my task.
Thank you in advance.
Hey there,
Hey there,
I think you can circumvent this issue by changing the World Center Mode: https://developer.vuforia.com/forum/unity-extension-technical-discussion/what-world-center-mode#comment-47076
Kind regards,
Patrick Scheper
Hi Patrick,
Hi Patrick,
Thank you for your reply. I'll check your link later.
In the meantime, I figured out the following solution myself.