Start a new topic

Getting the direction where the camera is facing

Getting the direction where the camera is facing

Hi All,

How can we get the direction in which camera is viewing. I want to know the direction like E, W, N, S other. Is it possible with wikitude SDK?

Thank You

Hi there!

You can achieve this by using AR.RelativeLocations. Those are locations that can be placed relative to the user's position. Via the northing and easting properties, those locations can be placed according to the cardinal directions. If you want to do a specific action when the camera is viewing in a certain direction you can use the "onEnterFieldOfVision" trigger of a AR.GeoObject.

Hope that helps!


Hi Markus Eder,

Thanks for the reply :)

This is fine but i wan't to know the direction of camera facing instead of placing some point using relative location. Also will onEnterFieldOfVision gives any direction parameter ?



Hi There!

As this functionality is not directly included in our SDK, the method I described is a workaround to get what you want.

So in that way the RelativeLocations serve as a placeholder for the cardinal directions. In order to use the onEnterFieldOfVision-trigger you can create a AR.GeoObject with the mentioned AR.RelativeLocation and a transparent drawable of your choice. In that way you will get information about the direction the camera is facing via the onEnterFieldOfVision-trigger and the created GeoObject will be invisible to the user through the transparent drawable (e.g. AR.Circle).

Hope that helps,

Login or Signup to post a comment