question

michel.torbey avatar image
1 Like"
michel.torbey asked Braydn T commented

Absolute Rotation of an object

example.fsmHi everyone,

I am trying to find the absolute rotation (model reference) of an object that is inside another object.

Does anyone have an idea of how it can be done?

Attached you can find an example model. In this model I have the red object in a plane. The plane is rotated 90 degrees on X and 90 degrees on Z.
The blue object is in the model, and is rotated 90 degrees on Y.

The objective would be to find the Rotation of the red object to the model (in this case it would be 90 degrees on Y).

Any suggestions?

Best regards,

FlexSim 19.0.2
agvrotationprojection
example.fsm (18.3 KiB)
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Braydn T avatar image
0 Likes"
Braydn T answered Braydn T commented

Hey @michel.torbey

We have been working on your problem and this is what we have figured out so far.

If you change your 3D shapes to something with a more obvious up and down (Like an ambulance or chair) 90 0 90 on the Plane does not give the same orientation for what was the red object as 0 90 0 on the other shape (what was the blue object).

If you think about the plane as a parent to the red object, and the red object has no rotation (or 0,0,0) the red objects absolute rotation in terms of the model is it's parent's (the plane) rotation.

The issue we are having trouble solving is if you add rotation to the child object, then it is much more complicated to find its absolute rotation. You will need a little bit of complicated math including projections and possibly linear algebra for a potentially very complicated piece of code.

In other words, if just your parent object has rotation, then the child objects absolute rotation in terms of the model is the parents rotation. If both the parent and child have rotation, then the absolute rotation of the child in terms of the model is quite a bit more difficult to figure out.

*Edit

There is a command in FlexSim that can do this, but you need to use Visual Studio to compile your program because the math it uses is in C++ libraries and not FlexScript. It would also take quite a bit of time to implement, so you would need to evaluate how much knowing the absolute rotation of an object would influence your ability to get valuabel statistics from your model, and whether the time would be worth it.

· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Braydn T avatar image Braydn T commented ·

Hey @michel.torbey

Did my answer work for you? If so, please click the accept button below the question. If not, is there another way we can help you?

0 Likes 0 ·