From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

3D Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

3D object hierarchy - in 3D pictures

Is it possible to obtain the hierarchy of 3D objects in 3D pictures (SceneObjects).

 

e.g. I have the name of a SceneObject.... I can get a reference to the SceneObject, but how do I get the reference to its parent to build a hierarchy.

It would be nice to be able to do this in both directions.... and build a tree structure showing how lights, textures, objects etc are all interrelated.

 

My first guess would have been to use "to more generic class"..... but no luck yet.

 

Update: OK, LabView does have this information.... because if I know where the item is in a scene, I can use the pickpoint method, and then get the hierarchy from the pickmodel method. This is quite a contrived work around. Surely there is a better way !

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

Hi Philippe_RSA,

 

If I understand correctly, you want to be able to obtain from the reference of a 3D object, in what object or scene that 3D object is. For example, let's say a cube is within a sphere that is placed within a 3D scene. From the cube  reference, you want to be able to get the sphere reference, and the 3D scene reference as well. Correct?

 

If that's the case, the "to more generic class" or "to more specific class" functions cannot help you. Those functions refer to inheritance. If the cube had inherited from the sphere, you could access the sphere properties and methods by making the cube "more generic" into a sphere. This is not the relationship between the 3D objects with other 3D objects or 3D scenes. The relationship is one of containment (using OOP jargon).

 

The cube is contained within the sphere. There is no actual inheritance relationship between the two objects. You can find what is in the sphere using the "Find object", "Get Object" and "Object count" methods (which I'm sure you found out) but I don't think that there is any way to see if a 3D object is contained within another one, and if yes, in which object it is contained (you can find which dollars are in one wallet, but you cannot find in which wallet a specific dollar is, or has been). 

 

One solution could be that you keep track of the hierarchy of the 3D object in your 3D scene using  the object names. Whenever you get an object, using its name, you extract the hierarchy from your own database.

 

Hope it helps and good luck.

Marc Dubois
0 Kudos
Message 2 of 3
(5,483 Views)

Thanks Marc

 

If I have a hierarchy of objects (e.g. sun and earth example), and spin the parent, the child rotates around it. It would be nice to be able to identify what causes the child to rotate by finding its "parent" in the hierarchy. Of course I am sure that the GPU knows this hierarchy, and hope this can be exposed in LabView. Of course, for now, I use an external hierarchy, but it occasionally breaks. For example when I have an axis (LabView 3D object), it is not so easy to make the external hierarchy, as it is made up of a number of cylinder and cones internally.  You may have noticed in the previous examples we shared (mouse click to find a primitive)  that if you clicked on the axis, the code breaks.....

Anyone else out there with a solution?

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