boat3d               package:orientlib               R Documentation

_D_r_a_w _b_o_a_t _g_l_y_p_h_s _f_o_r _o_r_i_e_n_t_a_t_i_o_n _d_a_t_a

_D_e_s_c_r_i_p_t_i_o_n:

     Draws a stylized sailboat to represent an orientation.

_U_s_a_g_e:

     boat3d(orientation, x = 1:length(orientation), y = 0, 
            z = 0, scale = 0.25, col = 'red', add = FALSE, box = FALSE, axes = TRUE,
            graphics = c('djmrgl', 'rgl', 'scatterplot3d'), ...)

_A_r_g_u_m_e_n_t_s:

orientation: An 'orientation' object to be shown. 

 x, y, z: Coordinates where boats should be shown. 

   scale: Size of boats 

     col: Colour of boats 

     add: Context in which to continue drawing, or 'FALSE' to clear
          first.  

     box: Whether to draw a box around the plot 

    axes: Whether to draw axes 

graphics: Which graphics package to use 

     ...: Additional graphics parameters; see Details below 

_D_e_t_a_i_l_s:

     For the identity orientation, the sailboats will be shown upright.
     Other orientations are shown as rotations of this glyph.

     The (x,y,z) coordinate appears in the middle of the sail, at the
     top of the gunwales of the boat.

     If either the 'djmrgl' or 'rgl' package is  installed, it will be
     used to draw solid faces on the boats which can be moved by the
     user.  If not, but the 'scatterplot3d' package is installed, it
     will be used to draw fixed wireframe boats.  This search order can
     be changed by modifying the 'graphics' parameter.

     Additional graphics parameters may be passed.  If 'djmrgl'
     graphics is used, then these are passed to 'par3d' before the
     plotting is done; if 'scatterplot3d' is used, these are passed to
     the 'scatterplot3d' function (and ignored when adding to an
     existing plot).  Extra parameters are not passed to 'rgl'.

     To add to a 'scatterplot3d' plot, you must pass the  return value
     from the initial plot as the value of 'add'.  See the 'orientlm'
     function for an example.

_V_a_l_u_e:

     A 'djmrgl' handle for the graphics display, a current plot number
     for 'rgl', or a 'scatterplot3d'  drawing context.  In any case, an
     attribute named 'graphics' is added to indicate the drawing device
     type.

_N_o_t_e:

     Requires the 'djmrgl', 'rgl' or  'scatterplot3d' package.

_A_u_t_h_o_r(_s):

     Duncan Murdoch

_E_x_a_m_p_l_e_s:

     x <- eulerzyx(psi=c(0,pi/4,0,0), theta=c(0,0,pi/4,0), phi=c(0,0,0,pi/4))

     # Need a 3D renderer; assume scatterplot3d, but others could be used

     s <- boat3d(x, 0:3, axes = FALSE, graphics = 'scatterplot3d')
     text(s$xyz.convert(0:3, rep(-0.5,4), rep(-0.5,4)), 
          label = c('Id','z','y','x'))
              
     ## Not run: 

     # if the djmrgl package is loaded, this code will work
              
     boat3d(x, 0:3, axes = FALSE)
     axis3d('yz',at=0:3,labels=c('Id','z','y','x'))

     # if the rgl package is loaded, this code will work

     boat3d(x, 0:3, axes = FALSE, graphics = 'rgl')
     rgl.bbox(xat=0:3,xlab=c('Id','z','y','x'),yat=1,zat=1,color='grey')  
     ## End(Not run)

