Graphics Programs Reference
In-Depth Information
Angle of the object about the axis perpendicular to the screen
(within an approximate range of -140 ° to 140 ° )
Fraction, that is, extent of deviation from the mean position
(within an approximate range of -1 to 1)
Pitch or tilt about the longer edge of device (within an approxim-
ate range of -1 to 1)
Gravity (within a range of 0 to 9.80665; it will never go beyond
that range, even if testing this app inside a black hole!)
Because of some default settings in this application, when the object (arrow head)
points along the positive y-axis (when the device is in landscape mode), east is indic-
ated. This direction is the mean position of the object. Angle and Fraction are posit-
ive when the object points toward the left of mean position ( Figure 2-18 ) , and they
are negative for the other case ( Figure 2-19 ) . We don't have to worry about Pitch ; the
Angle is sufficient to rotate the object.
Figure 2-19 . Rotating toward west through south (device facing up)
If you place your device flat on a surface and incline it, you should observe that, bey-
ond a certain inclination, the rotation stops ( Figures 2-20 and 2-21 ) . The SENSOR
ROTATION application contains this feature, because the object should only rotate
when the device is held (almost) parallel to the surface.
Search WWH ::

Custom Search