Reputation: 4157
Background:
a = 0; b = 0; c = 0;
Manipulate[Graphics3D[
GeometricTransformation[
{Cuboid[{0, 0, 0}, {1, 1, 1}]},
{RotationTransform[x, {1, 1, 0}, {a, b, c}]}],
ViewPoint -> Left], {x, 0, 2 \[Pi]}]
My question concerns RotationTransform with the following signature:
RotationTransform[x, {1, 1, 0}, {a, b, c}]
The documentation says: "gives a 3D rotation around the axis w anchored at the point p", in the example above w={1,1,0} and p={a,b,c}.
To my surprise the rotation acts the same no matter what values I assign to (a,b,c). I assume that I don't understand the docs, made an error somewhere. I would have expected at least a different rotation for different values of a,b,c. Changing the vector w behaves as expected.
Upvotes: 6
Views: 556
Reputation: 13141
May be this will make it clear. It does have an effect. I show the anchor point, and the axis.
Manipulate[
Module[{w={1,0,0},p={-2,2}},
Graphics3D[
{
{Opacity->.4,GeometricTransformation[
{Cuboid[{0,0,0}]},RotationTransform[angle,w,{a,b,c}]]
},
{Blue,PointSize[0.05],Point[{a,b,c}]},
{Red,Thick,Line[{{a,b,c},{a,b,c}+w}]}
},
ImageSize->300,
ImagePadding->2,AxesOrigin->{0,0,0},
ImageMargins->2,ViewAngle->All,
Axes->True,
Ticks->None,
PlotRange->{p,p,p}
]
],
{angle,0,2 \[Pi],ImageSize->Tiny},
{{a,0,"a"},0,1,.1,Appearance->"Labeled",ImageSize->Tiny},
{{b,0,"b"},0,1,.1,Appearance->"Labeled",ImageSize->Tiny},
{{c,0,"c"},0,1,.1,Appearance->"Labeled",ImageSize->Tiny},
ControlPlacement->Left
]
Upvotes: 4
Reputation: 61056
Consider the following example from the help:
gr={Cuboid[],AbsolutePointSize[10],Opacity[1],{Magenta,Point[{0,0,0}]},
{Green,Point[{1,1,1}]}};
p = {1,1,1};
Graphics3D[{{Opacity[.35], Blue, gr},
GeometricTransformation[{Opacity[.85], Red, gr},
RotationTransform[Pi/6, {0, 0, 1}, p]]}, Boxed -> False]
And now with :
p={1,0,0};
Upvotes: 6