Showing results for 
Search instead for 
Did you mean: 

Matching 3D models with its 3D coordinates (using 3D Picture Control)

Hi, all.

I'm working on a LabView project in which I have represented a robot model in a 3D Picture Control. Every part of the robot is a VRML model, that is loaded separately from each other, and placed with relative translations and rotations from the parent objects, functions included in the 3D Picture Control kit.

Now I need to detect contacts between two different pieces, for example, when the robot arm hits the ground, or another part of the robot. So, first of all, I need to obtain the relationship between every model part and the current 3D coordinates of its points.

I found that this isn't possible to achieve with functions such as "Get translation" or "Get rotation", because they only give you the local transformation, not the global (the one that also depends on the parent objects).

In addition, I know that the method "Pick point" allows you to match a 2D window coordinate (3D Picture Control window) with the 3D coordinate of the object that is first hit by a ray cast from this window coordinate. This seems to be more complex than what I want to do...

Is there any way of matching a 3D model with its current 3D coordinates?

Thanks in advance.

0 Kudos
Message 1 of 5

I have the same question:

How can I get the position and orientation of a 3D object in a scene.

The get rotation and get translation returns the local values, but not the global values.

How can I obtain the global values?

0 Kudos
Message 2 of 5

You can either maintain your own dictionary of parent-child relationships or use the "Get Object" method recursively from the top-level scene object to determine them. Then you have to multiply the 4x4 Transformation matrices for each level down and from there you can extract the global scale, rotation and translation. I believe the rotation order of the constituent homogenous matrices is Translation, Scale, Rotation.

0 Kudos
Message 3 of 5

Of course I can do all the maths again, but it would make sense that the drawing routines have already done this, and know exactly where it has drawn the object.

I understand from your solution that you do not believe that LabView exposes this information.... can this be true?

0 Kudos
Message 4 of 5

I believe that LabVIEW simply reports the object properties, and global orientation/position is not a property of the object, but an end product of the parent object transformations. I am not sure LabVIEW does know where the object is - OpenSceneGraph handles the drawing and sends it to the graphics card. It is a very simple interface that has some decent challenges associated with it.  There is no direct way of determining the parent object, for example.

0 Kudos
Message 5 of 5