Orientation - Roll


Well-Known Member
Licensed User

The attached diagram shows how the Roll angle is defined. Consequently,
when the lens side is pointed towards the sky, the altitude is measured from 0 +90 0, which is most inconvenient.

Is it possible to add a fourth parameter, such as

Sub Orientation_OrientationChanged (Azimuth As Float, Pitch As Float, Roll As Float, [COLOR="Red"]Altitude[/COLOR] As Float)

in order to obtain the natural range 90 0 -90 which is ideal for measuring altitude when the camera faces the sky.

Less important, though, is there a plan to add magnetic strength (uT)?



There is a workaround like:

Sub Orientation_OrientationChanged (Azimuth As Float, Pitch As Float, Roll As Float)
azm = Ang(Azimuth + 90)
alt = Roll
If CheckZ > 0 Then
alt = Roll - 90
alt = (90 - Roll)
End If
End Sub

Sub Accelerometer_AccelerometerChanged (X As Float, Y As Float, Z As Float)
CheckZ = Z
End Sub

Nevertheless, a direct read-out maybe smoother.


  • roll.gif
    2.9 KB · Views: 226
Last edited:


Well-Known Member
Licensed User
Thanks very much for looking into this, Erel. By quering the Z-axis of the Accelerator I get correct altitude values. Just thought it might be less CPU consuming without initializing the accelerator.

Magnetic field strength information may help compute magnetic declination for given locations that could be used to offset a compass (true north/magnetic north).

By the way, I saw in the API that there is a way to measure environmental brightness in lux. Could you eventually wrap that, too?
Upvote 0