read_6DOF, sequence_6DOF

Synopsis

read_6DOF reads a 6-degree-of-freedom (6DOF) trajectory file and outputs 6 arrays of data. sequence_6DOF animates the motion of an object along the path represented by that data.

Input Ports

Name Type Description Module

in_xform Xform Transformation that is to be altered. sequence_6DOF
filename string Name of 6DOF file to read. both

Parameters

The sequence_6DOF macro uses the loop module internally. Please see the AVS/Express documentation for a full description of the parameters of the loop module. The read_6DOF macro does not use any parameters.

Name Type Description Module

scale float Specifies the transform scaling factor. sequence_6DOF

Output Ports

Name Type Description Module

x_comp float[] X component of the trajectory translation. read_6dof
y_comp float[] Y component of the trajectory translation. read_6dof
z_comp float[] Z component of the trajectory translation. read_6dof
pitch float[] pitch component of the trajectory rotation. read_6dof
roll float[] roll component of the trajectory rotation. read_6dof
yaw float[] yaw component of the trajectory rotation. read_6dof

Description

The two user macros in the Read6DOF project are used to read a trajectory data file and animate an object along that trajectory.

The read_6DOF macro is used to read a 6-channel ASCII file that contains position and rotation values for an object over a number of time steps. The format of the ASCII file is straightforward. It contains 6 columns of data which are separated by tab characters. The columns of data represent:

  1. X translation
  2. Y translation
  3. Z translation
  4. Pitch
  5. Roll
  6. Yaw

The sequence_6DOF macro extends the functionality of the read_6DOF of macro by modifying a transform matrix that is being used to control an object. It also allows the time steps contained in the trajectory data to be looped through. The macro does this by using the read_6DOF macro, the GD_xform_edit module and the loop module. The read_6DOF macro reads in a trajectory data file. The GD_xform_edit module generates a transform matrix from a single time step of the trajectory data and the loop module cycles through the time steps contained in the data.

The transform matrix that is modified of the sequence_6DOF macro can be found by exporting the Xform block from any standard module (i.e. Read_Geom) or DataObject. The example application shows how this can be done.

Inputs

in_xform

The transform matrix that is to be modified by the sequence_6DOF macro.

filename

This string input specifies the name of the file containing the 6DOF data. Standard AVS/Express environment variables can be used. Both of the user macros provide this input.

Parameters

scale

Floating point parameter that specifies the scaling factor that is to be applied to the modified transformation.

Loop Controls

The sequence_6DOF macro uses the standard loop module to cycle through the trajectory data. Please see the AVS/Express documentation for a full description of the parameters of the loop module.

Outputs

x_comp[] y_comp[] z_comp[]

Floating point arrays that contain the X, Y and Z translations for each time step in the trajectory data. These can be directly input into the GD_xform_edit module to generate a standard Xform block that can be used to transform field data or geometry.

pitch[] roll[] yaw[]

Floating point arrays that contain the pitch, roll and yaw rotations for each time step in the trajectory data. These can be directly input into the GD_xform_edit module to generate a standard Xform block that can be used to transform field data or geometry.

Utility Macros

The read_6DOF macro uses the Read_6DOF_UI user interface macro. The sequence_6DOF macro uses the read_6DOF macro.

Example

The Read_6DOF_Eg example application reads in the standard Teapot geometry and animates it through a flight path specified by the trajectory contained in the "6dof.dat" data file.

Files

iac_proj/rd_6dof/6dofmacs.v contains the V definitions of the Read_6DOF_UI UI macro, the read_6DOF and sequence_6DOF user macros and the Read_6DOF_Eg example application.

Other Notes

This reader does not use external C or C++ code. It uses the FILE object to read the data file directly from V code. The cache() function is used so that data persists in memory and does not have to be reloaded. This project provides a good example that could be used for developing other FILE object based readers.

Authors

Leigh Grundy, Ian Curington
Advanced Visual Systems, Inc.

Modifications

Andrew Dodd
International AVS Centre

Contact

International AVS Centre
Manchester Visualization Centre
Manchester Computing
University of Manchester
Oxford Road
Manchester
United Kingdom
M13 9PL