Setting general orientation on object

Technical discussions
Post Reply
Elph
Posts: 1
Joined: Wed Jul 17, 2019 7:05 am

Setting general orientation on object

Post by Elph »

Hello all
I have a 3d transform in from of a matrix. How do I apply this transform to an object, say a triangular prism?
Thanks

nickz
Site Admin
Posts: 236
Joined: Fri Jul 26, 2013 3:58 am

Re: Setting general orientation on object

Post by nickz »

Hello Elph

What you need is to get IFrame* from the entity and define it in such a way that it is an image of standard(=global) frame under your transform.

Assuming the matrix is orthogonal (determinant is 1.0) and is 3x3, taking columns and copying them as axes to the frame should do the trick. If this does not work try the same for rows instead.
IFrame_DG.SetAxes() http://dynoinsight.com/Help/V6_0/Interf ... px#SetAxes is one way to defining the target frame.

If your matrix has 4x4 size the first 3 elements of the last column (or row) normally define origin of the frame. It can be copied via IFrame_DG.SetOrigin() http://dynoinsight.com/Help/V6_0/Interf ... #SetOrigin

This topic might be of use also: viewtopic.php?f=2&t=2975

If the matrix is not orthogonal it means there is some scaling involved. It can be done also with bit more of work. Let me know if you need that. Case of negative determinant is completely disastrous :P as this means that your transform flips orientation and most likely you will need to use left handed axes to render
Cheers

Post Reply