As you have undoubtedly noticed when you group Model3Ds into Model3DGroup, the Transform properties of the children are combined with the properties of the parent.
It looks like you are asking how to calculate the network transform to a specific Model3D in the Model3D tree, which is what you call your βmodelβ. To do this, you need to know (or be able to scan and detect) the path from the Model3DGroup root model to Model3D for which you want to find the transformation.
Once you have this path, all that is required is a union of the Transform properties at each level. To do this, simply create a Transform3DGroup and add individual transformations to it.
For example, if your robot has Model3D components called UpperArm, LowerArm, and Hand, and you would like to know the position and angle of the arm that you could do:
var combined = new Transform3DGroup(); combined.Children.Add(UpperArm.Transform); combined.Children.Add(LowerArm.Transform); combined.Children.Add(Hand.Transform);
Now you can find the location (0,0,0) on the arm as follows:
combined.Transform(new Point3D(0,0,0));
Similarly, you can find other points and use them to place another ModelVisual3D.
Ray burns
source share