any SetTransformMatrix?

Ok. That’s done. A new feature for 7.2.

The only thing that has to be remembered is that M4,3 is 3DC’ (2, 3). The way of describing the elements is reversed with 3DC and it is zero based. So, simply reverse the elements, and subtract 1.

I notice that there is a ‘GetTransformMatrix’ but is there any way to ‘SetTransformMatrix’ in which one can Translate, Scale and Rotate a series of (Group?) copies?

Unfortunately no SetTransformMatrix, just SetPosition and SetRotation.

Scaling via matrix is not possible at the moment.

OK thanks
What about Scale or SetSize?

I really should have a ‘SetTransform’. It is pretty straight forward. In fact, internally I store the relative transform, not the relative position, direction vector and up vector.

Scaling via matrix won’t likely be supported any time soon.

I think for fun, I might just do this. My favourite 3DC work is the API.

This is pretty straight forward,

The direction vector is m31,m32,m33

The up vector is m21,m22,m23

The position is m41,m42,m43 which for 3DC is: matrix(0,3),matrix(1,3),matrix(2,3)

I think I have that right. The hitch is that it is possible to set the orientation/position at particular times, so I think I will write a wrapper to the existing setposition/setorientation and let them deal with the details.

A nice little break for me.

So, basically this:

‘set its position
udtPosition.X = udtInstance.mTM(0, 3)
udtPosition.Y = udtInstance.mTM(1, 3)
udtPosition.Z = udtInstance.mTM(2, 3)
cgaGroups(lInstance).SetPosition cgParentGroup, -1, udtPosition

‘set its orienation
udtOrientationDir.X = udtInstance.mTM(0, 2)
udtOrientationDir.Y = udtInstance.mTM(1, 2)
udtOrientationDir.Z = udtInstance.mTM(2, 2)
udtOrientationUp.X = udtInstance.mTM(0, 1)
udtOrientationUp.Y = udtInstance.mTM(1, 1)
udtOrientationUp.Z = udtInstance.mTM(2, 1)
cgaGroups(lInstance).SetOrientation cgParentGroup, -1, udtOrientationDir, udtOrientationUp

I knew I had written this before, it was just a matter of finding it. This is a great example of why whenever you ‘create’ something that might be of use later, you should make it general purpose and put it in a collection of helper functions.

You must be logged in to reply in this thread.