.. _group__a3d__cartesiantransfo3d:

########################
Cartesian Transformation
########################

Functions and structures for defining combinations of transformations (without the use of a matrix)

Entity type is :c:enumerator:`~kA3DTypeMiscCartesianTransformation`\ .

This entity describes combinations of transformations such as relocation to a new 3D Cartesian coordinate system, scaling, and rotation. The :c:struct:`~A3DMiscCartesianTransformationData`\ structure provides parameters for the transformation. The behaviour mask specified by the :c:member:`A3DMiscCartesianTransformationData::m_ucBehaviour <A3DMiscCartesianTransformationData.m_ucBehaviour>`\ member specifies the transformations that apply. Those transformations must be consistent with the actual data provided in other fields as described here:


- If the ``m_sOrigin``\ member is null vector, translation is disabled.
- If the ``m_sXVector``\ member is (1,0,0) and ``m_sYVector``\ member is (0,1,0), rotation is disabled.
- If the ``m_sScale``\ member is (1,1,1), scaling is disabled.
- If the ``m_sXVector``\ and ``m_sYVector``\ members are not perpendicular or if they are not unit vectors, the data is invalid.


Sample code
===========


::

   A3DMiscCartesianTransformationDatasData=A3D_MAKE_DATA(A3DMiscCartesianTransformationData);
   A3DUns32iErr=A3DMiscCartesianTransformationGet(pCsys,&sData);
   if(iErr==A3D_SUCCESS)
   {
   /*InserthereyourowncodetoparsethroughmembersofCartesianTransformation3d*/
   iErr=A3DMiscCartesianTransformationGet(A3D_NULL_HANDLE,&sData);
   }


   2.3



   Some particular formats do not support Cartesian transformations directly, but define general ones instead. When possible, the associated readers try to make cartesian tranformations out of them, setting this Behaviour flag. In all cases, except for Mirror, direct use of transformation members is valid, where behavior is just informational.



**Returns**


   ``A3D_SUCCESS``\ on success, or an error code on failure


.. rst-class:: kind-group kind-topic

.. rubric:: Topics
   :class: kind-group-title


.. rst-class:: api-xref-list


* :ref:`Cartesian Transformation Types <group__a3d__transformationbit>`

.. rst-class:: kind-group kind-record

.. rubric:: Structures
   :class: kind-group-title


.. rst-class:: api-xref-list


* :c:struct:`~A3DMiscCartesianTransformationData`

.. rst-class:: kind-group kind-function

.. rubric:: Functions
   :class: kind-group-title


.. rst-class:: api-xref-list


* :c:func:`~A3DMiscCartesianTransformationGet`
* :c:func:`~A3DMiscCartesianTransformationCreate`

.. toctree::
   :maxdepth: 1
   :hidden:

   a3d_transformationbit
   ../structures/A3DMiscCartesianTransformationData
   ../functions/A3DMiscCartesianTransformationGet
   ../functions/A3DMiscCartesianTransformationCreate


