/
writeRot

writeRot

Description

Use to write one or more rotation values to a file. This command accepts any number of vector arguments, including arrays.

The following list shows the different cast types. Note that data can be lost when casting. 'Signed' means the value can be negative. 'Unsigned' means value will always be positive.

CastDescription
"c"Writes each rotation channel value as a signed character, or a signed 8 bit (1 byte) value
"uc"Writes each rotation channel value as an unsigned character, or an unsigned 8 bit (1 byte) value
"s"Writes each rotation channel value as a signed short integer, or a signed 16 bit (2 bytes) value
"us"Writes each rotation channel value as an unsigned short integer, or an unsigned 16 bit (2 bytes) value
"i"Writes each rotation channel value as a signed integer, or a signed 32 bit (4 bytes) value
"ui"Writes each rotation channel value as an unsigned integer, or an unsigned 32 bit (4 bytes) value
"f"Writes each rotation channel value as a floating point value, a 32 bit (4 byte) value

Functional area

Disk I/O

Command syntax

Syntax

writeRot fileID rotValue1 [rotValue2...] [-delim string] [-quat] [-rotOrder string] [-cast string] [-rad]

Arguments

NameTypeRequiredComments
rotation2optional vector or vector array
Command can accept any number of vectors/arrays to write to the file
rotation1

Vector or vector array: 1 or more values to be written to the file
fileIDint
ID of file previously opened with fileOpen

Flags

NameFlag argumentsArgument typeExclusive toComments
delim1stringDelimiter to use between rotation channel values. Cannot be used with binary files. Usually"," or "\t", etc.
quat0rotOrderSpecifies that the rotation should be written as a quaternion (four float values) rather than an Euler angle (three float values). Can not be used with -rotOrder option
rotOrder1stringquat
Specifies the rotation order that the rotation will be written in. Can not be used with -quat option (possible values are XYZ, XZY, YXZ,YZX, ZXY, and ZYX)
cast1stringData type to cast to. Possible types are listed above. Note that data can be lost when casting.
rad0quat

Return value

void

Examples

//Rot write example
vector $rot = << 25.0, -70.5, 19 >>;
int $fileID;
int $fileID = `fileOpen "C:/FileTesting.txt" "w"`;

// Write the rotation value as an Euler angle
// The -delims flag assumes you are writing to a text file 
writeRot $fileID $rot -delim ",";
fileClose $fileID;

Additional information

Related commands