Class PhoneView

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants

public class PhoneView extends JFrame
Illustration of rotating smartphone used to visualize rotations
See Also:
  • Constructor Details

    • PhoneView

      public PhoneView()
      PhoneView constructor The constructor assumes default values for size and everything.
  • Method Details

    • setRotation

      public void setRotation(double w, double x, double y, double z)
      Set rotation of illustration Set the rotation of the smartphone illustration given a rotation described by the normalized quaternion q = (q_w, q_x, q_y, q_z).
      Parameters:
      w - The q_w component of a normalized quaternion.
      x - The q_x component of a normalized quaternion.
      y - The q_y component of a normalized quaternion.
      z - The q_z component of a normalized quaternion.
    • addLights

      protected void addLights(javax.media.j3d.BranchGroup b)
      Create suitable lighting for the scene
      Parameters:
      b - Graph to add the light to
    • main

      public static void main(String[] args)
      PhoneView illustration demo application The demo application creates a smartphone view, starts up a server that a smartphone can connect to using the sensor fusion android app. The view will then follow the phones orientation as it is turned.
      Parameters:
      args - Arguments passed to the function are ignored.