Kyle Neath

I'm doing some animations spinning some panels around the Y-Axis, and I was wondering if there's a way to translate the axis of rotation. What I mean is best described by this graphic: http://kyleneath.com/share/axis_confusion.gif

The axis on the left is what you get when you specify Axis="0,1,0" in a AxisAngleRotation3D, but I'm looking to achieve the axis on the right side. Effctively, I want to translate my axis from the centroid to the far X edge.


Re: Windows Presentation Foundation (WPF) Axis of Rotation

Charles Petzold

The Axis property stays the same in this case. Change the center of rotation with the CenterX, CenterY, and CenterZ properties of RotateTransform3D. (In this case, CenterY will have no effect.) Basically, pick any point on the panel that you don't want moved, and set CenterX and CenterZ to that point.

My new book "3D Programming for Windows" has a 48-page chapter devoted to AxisAngleRotation3D.