LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

3D scene objects rotate/translate independently

Solved!
Go to solution

Hi everyone,

 

I am currently working on a program that will eventually have 3 IMUs controlling roll, pitch and yaw of 3 objects on a 3D scene.

I am struggling to find how to have 3 objects moving individually in a 3D scene. currently, when I move "IMU #1" it rotates in reference to "IMU #2". I would like it to stay in its same place and move on its own. Any help or direction on how to do this would be greatly appreciated.

 

thank you.

Download All
0 Kudos
Message 1 of 4
(2,128 Views)

I haven't played with these functions recently, but it sounds like what is happening is that you take a shape, can (but don't) transform it by rotation/translation, place it "in the scene", and then do another transformation, which now is acting on the scene (and everything that is in it).

 

Try taking your Objects, transforming them independently, and then adding them to the scene.  Especially with rotations, "order matters" (or as Mathematicians would say, "Rotations don't commute").

 

Bob Schor

Message 2 of 4
(2,071 Views)

Since i want this to be interactive in the program through the dials, how would i do this with the while loop?

I believe my translate is transforming #1 independently before the scene like your are saying, but how would I do the same with the rotations?

 

I tried connecting them to the to the Object pins on the scene:Object.add object but this resulted in a similar situation

0 Kudos
Message 3 of 4
(2,057 Views)
Solution
Accepted by topic author marcusRamirez19

You need to translate the parent Scene object of IMU#1 (and not IMU#1 itself) after it is added to the scene. You also need to rotate IMU#1 and not it's parent Scene object. The reason is that Translation is applied first, then Scaling, then Rotation (when applied to the same object). This is regardless of the order in which you set those particular properties.  The other alternative is to roll your own 4x4 Transformation matrix and set it using a property node for the Scene Object.

Message 4 of 4
(2,037 Views)