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.