LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to rotate a group of objects in 3d picture

Solved!
Go to solution

There are examples on how to rotate an object independently like the solar system one.  However, I am having a challenge in that I have created a face of a rubik's cube that has several little cubes in ti and want to rotate just one row of the little cubes across the face. Does anybody know how to to rotate multiple objects about a single rotation point in a 3D Picture control ? See photo below.

 

http://www.google.com/imgres?num=10&hl=en&biw=1131&bih=475&tbm=isch&tbnid=h8yi5Gx0qZzhwM:&imgrefurl=...

 

 

 

0 Kudos
Message 1 of 5
(3,128 Views)

Hi id,

 

Take a look at this example, this may help out. This sounds like a very interesting project!

 

https://decibel.ni.com/content/docs/DOC-8262

Matt S.
Industrial Communications Product Support Engineer
National Instruments
0 Kudos
Message 2 of 5
(3,114 Views)
Solution
Accepted by topic author id

Thanks Matt.  That was a great example of how to rotate a single object in multiple ways.  I appreciate your answer as it gets me thinking more. 

 

My challenge is to be able to rotate several cubes all at the same time but as a face, not each at the same angle.  So, I guess that I have to pick a point as the axis to rotate the object about and then have ach one rotate at a differnt angle in order to keep the face flat.

 

I just don't know how to rotate a cube about a point that is off from the cube in a scene. Here is a jpeg of my challenge.  I want to rotate each plate of cubes by a user control.

 

 

0 Kudos
Message 3 of 5
(3,107 Views)

You can group objects into a scene and then if you rotate the scene instead of the objects they will maintian their relative positions.  You can also retain a reference to each individual obhject and rotate them individually, thus allowing also objects within a group to move or rotate relative to each other.

 

To rotate an object whose position is away from 0,0,0, first Get translation, Get Rotation, Undo Translation (Clear translation is the name of the function I think) Apply rotation change (if rotation is a delta instead of absolute), Re-apply Translation and voila.

 

3d Object rotation example.png

 

You can also retrieve Objects by name allowing easy access to either single or compound objects as required.

 

Shane.

Message 4 of 5
(3,103 Views)

Excellent answer.  Thanks

0 Kudos
Message 5 of 5
(3,096 Views)