Posts: 6
	Threads: 3
	Joined: Aug 2017
	
Reputation: 
0
	 
 
	
	
		Hello,
Assuming I have 4 ModelVisual3D objects. And those objects are children of each other. 
E.g. A is the root object, B is the children of A, C is the children of B and D is the children of C.
Now I rotate A around the X-Axis, B around the Y-Axis and C around the z-Axis. 
Is there a AB4D Function or Method I can use which tells me how D is rotated? I need the values to rotate D back in its standard orientation, as if it was not a children of any of the parent objects.
Best Regards,
Nick
	
	
	
	
		
	
 
 
 
	
	
	
		
	Posts: 766
	Threads: 8
	Joined: Sep 2009
	
Reputation: 
58
	 
 
	
	
		You can get the combined transformation of the final ModelVisual3D with using Ab3d.Utilities.TransformationsHelper.GetVisual3DTotalTransform and pass A and D objects to the method - this will get you one Transform3DGroup with all transformations from A to D.
If you know that you will only get RotateTransform3D objects in the Transform3DGroup, you can read the rotations from them.
But to use any transformation, you can read the Value property of the returned Transform3D - this will give you the total transformation Matrix3D.
To get the transformation that will cancel the parent transformations, you need to inverse this matrix.
You can do this by saving the Matrix3D to local matrix variable and then calling Inverse method on the matrix.
For the inverse matrix, you can create a new Matrix3DTransform and use the new matrix for it.
	
	
	
Andrej Benedik
	
		
	
 
 
 
	
	
	
		
	Posts: 6
	Threads: 3
	Joined: Aug 2017
	
Reputation: 
0
	 
 
	
	
		Thank you for your fast reply.
I had a look into the online "Ab3d.PowerToys reference help" for the TransformationHelper, but I can only find a Method "GetModelTotalTransform(...)" which would use Model3Ds. 
I know that every ModelVisual3D have a Model3D as Content. But I have alle transformation applied to the ModelVisual3D. 
When I tried to use the "GetModelTotalTransform(...)" Method with the Contents of the ModelVisual3Ds I didn't got a useful output. Maybe it is because we apply all transformation to the ModelVisual3D, so the "GetModelTotalTransform(...)" Method only adds all Transformations of the Model3Ds.
A "GetVisual3DTotalTransform(...)" Method sounds promising, is this maybe in a new version of the Ab3D framework available and I have an old version?
Best regards,
Nick