function [customTrans,customRot] = vranimCustomTransform(trans,rot)
%VRANIMCUSTOMTRANSFORM Perform a coordinate transform
%

% Copyright 2006-2012 The MathWorks, Inc.

% Correct translation for asttkoff model

% Determine DCM to convert flat Earth XYZ to example node's VRML xyz 
%
% Define direct cosine matrix between flat Earth and example node's VRML
% coordinate systems
% (x-left, y-out, z-up versus x-out, y-up, z-left from the screen perspective)
% (x-nose, y-left, z-up versus x-left, y-up, z-nose from the node
% perspective) giving the total direction cosine matrix of 
% dcmRotBodyVRML = angle2dcm(pi/2, 0, pi/2, 'zyx'); 
dcmRotBodyVRML = [ 0 1 0; 0 0 1; 1 0 0];

% Construct the default definition of the direct cosine matrix between
% aerospace body and VRML coordinate systems 
% (x-left, y-in, z-down versus x-right, y-up, z-out) giving the
% direction cosine matrix of dcmDefault = angle2dcm(pi, 0, -pi/2, 'zyx');
dcmDefault = [ -1 0 0; 0 0 -1; 0 -1 0]; 

% Determine the direction cosine matrix needed to result in dcmRotBodyVRML
% vrmlTrans = dcmRotBodyVRML*trans; 
% or
% vrmlTrans = [dcmDefault*dcmCustom]*trans;
% or
% customTrans = dcmCustom*trans;
% vrmlTrans   = dcmDefault*customTrans;
%
% dcmDefault = [ 0 -1 0; -1 0 0; 0 0 -1;]; 
dcmCustom = dcmDefault'*dcmRotBodyVRML;

% Convert translational location
customTrans = (dcmCustom*trans')';

% Convert rotational angles
customRot   = (dcmCustom*rot')'; 

%[EOF] vranimcustomTransform.m