<!-- Converted by db4-upgrade version 1.0 -->

<refentry xmlns="http://docbook.org/ns/docbook" version="5.0" xml:id="anim_offset1">
  <refmeta>
    <refentrytitle>ANIM_OFFSET</refentrytitle>
    <manvolnum>nged</manvolnum>
    <refmiscinfo class="source">BRL-CAD</refmiscinfo>
    <refmiscinfo class="manual">BRL-CAD User Commands</refmiscinfo>
  </refmeta>
  <refnamediv xml:id="name">
    <refname>anim_offset</refname>
    <refpurpose>create an animation table for an object rigidly attached to another object.</refpurpose>
  </refnamediv>
  
  <!-- body begins here -->
  <refsynopsisdiv xml:id="synopsis">
    <cmdsynopsis sepchar=" ">
      <command>anim_offset</command>    
      <arg choice="plain" rep="norepeat">-o <replaceable>#</replaceable> <replaceable>#</replaceable> <replaceable>#</replaceable></arg>
      <arg choice="opt" rep="norepeat">-r </arg>
      <arg choice="plain" rep="norepeat"><replaceable>in.table</replaceable></arg>
      <arg choice="plain" rep="norepeat"><replaceable>out.table</replaceable></arg>
    </cmdsynopsis>
  </refsynopsisdiv>
  
  
  <refsection xml:id="description"><info><title>DESCRIPTION</title></info>
    
    <para>
      This filter operates on animation tables of the type used by <emphasis remap="I">tabsub</emphasis>
      and <emphasis remap="I">anim_script.</emphasis> Given a table specifying the position and
      orientation of one object at every applicable time, <command>anim_offset</command>
      calculates the position of another object which is rigidly attached to it.
    </para>

    <para>
      The columns of the input table should be time, three columns of
      position, followed by yaw, pitch, and roll. The output will 
      normally be a four-column file specifying time and position. If the
      <option>-r</option> option is used, the output is a seven-column file in which the last
      three columns are copies of the orientation information from the input
      file.
    </para>
    
    <para>
      The position of the object relative to the rigid body should be
      given on the command line in the order x, y, z, with the
      <option>-o # # #</option> option.  These offset values
      should be as measured from the centroid of the rigid  body.
    </para>
  </refsection>

  <refsection xml:id="examples"><info><title>EXAMPLES</title></info>
    
    <para>
      This filter could be used, for example, to do an animation where
      the camera is placed inside a moving vehicle.
    </para>

    <para>
      Suppose that truck.table contains the desired position of the
      center of the front axle of the truck as well as its orientation at each
      time. One row of the table might look like this:
    </para>
    <literallayout remap=".nf" class="normal">

35.2	12450	-140	600	90.0 	0.0	0.0

    </literallayout> <!-- .fi -->
    <para>
      Thus 35.2 seconds into the animation, the center of the front axle will
      be at (12450, -140, 600), and the truck will be pointed in the positive
    y direction. (yaw = 90).
    </para>
    
    <para>
      Now, suppose we want the camera to ride along in the cab, above
      and behind the front axle and somewhat to the left. To specify this
      offset, we use the coordinate frame of the truck, with the origin at the
      center of the front axle, the x-axis to the front, y to the left, and z
      pointing up. Let the exact offset from the axle to the desired camera
      position in this case be (-600, 900, 1200), in units of mm. Now we use
      the routine:
    </para>
    <literallayout remap=".nf" class="normal">

anim_offset -o -600 900 1200 &lt; truck.table &gt; camera.table

    </literallayout> <!-- .fi -->
    <para>
      The result is a four-column table giving the desired position of the
      virtual camera at each time. The row corresponding to the sample row
      above would be:
    </para>
    <literallayout remap=".nf" class="normal">

35.2	11550	-740	1800

    </literallayout> <!-- .fi -->
    
    <para>
      With the <option>-r</option> option, the output would have been:
    </para>
    <literallayout remap=".nf" class="normal">

35.2	11550	-740	1800	90.0 	0.0	0.0

    </literallayout> <!-- .fi -->
    
    <para>
      Now <emphasis remap="I">tabsub</emphasis> and/or <emphasis remap="I">anim_script</emphasis>
      can be used to process these two animation tables into an animation script.
    </para>
  </refsection>
  
  <refsection xml:id="bugs"><info><title>BUGS</title></info>
    
    <para>
      The program will only use orientations specified as yaw, pitch, and roll. You can get around this using
      <emphasis remap="I">anim_orient</emphasis>, which converts between different orientation representations.
    </para>
  </refsection>

  <info>
    <author>
      <personname>Carl J. Nuzman</personname>
      <contrib></contrib>
    </author>
  </info>
 
  <refsection xml:id="copyright"><info><title>COPYRIGHT</title></info>
  <para> This software is Copyright (c) 1993-2012 by the United States
  Government as represented by U.S. Army Research Laboratory.</para>
  </refsection>
  
  <refsection xml:id="bug_reports"><info><title>BUG REPORTS</title></info>
  <para>Reports of bugs or problems should be submitted via electronic
  mail to &lt;devs@brlcad.org&gt;.</para>
  </refsection>
</refentry>
