Setting general orientation on object

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

Setting general orientation on object

Postby Elph » Wed Jul 17, 2019 7:10 am

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: 200
Joined: Fri Jul 26, 2013 3:58 am

Re: Setting general orientation on object

Postby nickz » Thu Jul 18, 2019 7:39 am

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/Interface/VectorSpace/IFrame_DG.aspx#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/Interface/VectorSpace/IFrame_DG.aspx#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


Return to “General Issues”

Who is online

Users browsing this forum: No registered users and 3 guests