Don’t be. I am basically giving you advice on how to inspect the models you create with the C API.

The desktop editions can have extensions. The extension I told you about, will allow you to inspect the transformation matrices of the instances that you transform. Ie, it’s a self help avenue.

Firstly, again I remind you that SketchUp’s modeling axes are different from game engines.

Z is up, X is to the right (points toward east,) Y runs away from the viewer (and is north 0 degrees.)

A simple single rotation would be done by creating a rotational transform.

`SUTransformationRotation`

- The
argument places the rotational axis`point`

somewhere in 3D space.`vector`

This does not have to be (but can be) within or even near the instance itself. - The
argument is the axis of rotation.`vector`

- The
argument will be the angle to rotate about the axis defined by the`angle`

argument.`vector`

- You can use the
`SUDegreesToRadians()`

function to specify values in degrees.

- You can use the

If you wish a compound rotation, then you’ll need to create 2 rotational transforms, and multiply them together, using the `SUTransformationMultiply()`

function, and then apply the resultant transform to the instance.

You can also “mix in” translational and scaling transforms by multiplying them also.

But they are traditionally applied in a particular order. Translational first. Rotational second in (X, Y then Z order.) Then Scaling (X, Y then Z order.) Decomposing a transformation matrix must be done in reverse order. (*See Aerilius’ code … link posted below*.)

You could try this …

- You get the transform of the instance.
- from this you get the transform’s 3 axial vectors (X, Y and Z.)
`SUTransformationGetXAxis`

,*etc.* - You get the model’s global Axes object …
`SUModelGetAxes`

- from this you get the model’s 3 axial vectors (X, Y and Z.)
`SUAxesGetXAxis`

,*etc.* - You compare each of the 3 corresponding instance transformation axis with the model’s corresponding axis.

… ie X for X, Y for Y,*etc.*using`SUVector3DAngleBetween`

- You can use the
`SURadiansToDegrees()`

function to convert the values to degrees.

- You can use the

Note that the both (Ruby and C) API’s may have a limitation with the angle between method/function. I think it works using dot product for vectors which always returns a value between 0 and 180. (May not be a problem if the return value is signed.)

There are some ways to use trigonometry on the matrix values to get the axial rotations.

Aerilius posted code in Ruby here …