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,

example.fsm
(18.3 KiB)

Comment

Best Answer

**Answer** by braydn.t ·

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.

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?

Stop AGV rotation 1 Answer

how to change the position of an axis ? 1 Answer

Why dosn't AGV pick up item when destination is set in custom code? 1 Answer

How to load only trailers and not AGV 2 Answers

AGV New Load Types 1 Answer

© 1993- FlexSim Software Products, Inc. All Rights Reserved.

FlexSim is a fully 3D simulation software environment. FlexSim can be used to simulate any process in any industry.

FlexSim®, FlexSim Healthcare™, Problem Solved.®, the FlexSim logo, the FlexSim X-mark, and the FlexSim Healthcare logo with stylized Caduceus mark are trademarks of FlexSim Software Products, Inc. All rights reserved.

- site links
- www.flexsim.com
- contact us
- blog
- privacy policy
- archived forum

- Anonymous
- Sign in
- Create
- Ask a question
- Post an idea
- Create an article
- Spaces
- Software & Simulation Questions
- Accounts & Licensing
- FlexSim
- FlexSim Healthcare
- Explore
- Topics
- Questions
- Ideas
- Articles
- Users
- Badges