Skip to main content
added 766 characters in body
Source Link
Nasser
  • 156.1k
  • 12
  • 173
  • 396

how you would suggest "making the rotation vector variable as well",

One way is to make a popumenu and select the rotation vector from a list

enter image description here

Manipulate[ Graphics3D[ {{Yellow, Opacity[.05], Cuboid[{-0.5, -0.5, -0.5}]}, Rotate[Cuboid[{-0.5, -0.5, -0.5}], x Degree, w, {0, 0, 0}]}, Boxed -> False, PlotRange -> {{-1, 1}, {-1, 1}, {-1, 1}}] , {{x, 0, "degree"}, 0, 180, 0.1, Appearance -> "Labeled"}, {{w, {0, 0, 1}}, {{0, 0, 1} -> {0, 0, 1}, {0, 1, 0} -> {0, 1, 0}, {1, 0, 0} -> {1, 0, 0}, {1, 1, 0} -> {1, 1, 0}, {1, 0, 1} -> {1, 0, 1}}, PopupMenu}, TrackedSymbols :> {x, w}] 

how you would suggest "making the rotation vector variable as well",

One way is to make a popumenu and select the rotation vector from a list

enter image description here

Manipulate[ Graphics3D[ {{Yellow, Opacity[.05], Cuboid[{-0.5, -0.5, -0.5}]}, Rotate[Cuboid[{-0.5, -0.5, -0.5}], x Degree, w, {0, 0, 0}]}, Boxed -> False, PlotRange -> {{-1, 1}, {-1, 1}, {-1, 1}}] , {{x, 0, "degree"}, 0, 180, 0.1, Appearance -> "Labeled"}, {{w, {0, 0, 1}}, {{0, 0, 1} -> {0, 0, 1}, {0, 1, 0} -> {0, 1, 0}, {1, 0, 0} -> {1, 0, 0}, {1, 1, 0} -> {1, 1, 0}, {1, 0, 1} -> {1, 0, 1}}, PopupMenu}, TrackedSymbols :> {x, w}] 
added 40 characters in body
Source Link
Nasser
  • 156.1k
  • 12
  • 173
  • 396

Is this what you want? The rotation vector is fixed in this code. But can easily make it variable as well.

enter image description hereenter image description here

Manipulate[ Grid[{{Graphics3D[   {{Yellow, Opacity[.05], Cuboid[{-0.5, -0.5, -0.5}]},  GeometricTransformation[Cuboid[{-0.5, -0.5, -0.5}],   RotationTransform[x Degree, {1, 0, 0}]]},   Boxed -> False,   PlotRange -> {{-1, 1}, {-1, 1}, {-1, 1}}] , {{x, 0, "degree"}, 0, 180, 0.1, Appearance -> "Labeled"}, TrackedSymbols :> {x}] 

You can also just use Rotate function

enter image description here

Manipulate[ Graphics3D[ {{Yellow, Opacity[.05], Cuboid[{-0.5, -0.5, -0.5}]}, Rotate[Cuboid[{-0.5, -0.5, -0.5}], x Degree, {0, 0, 1}, {0, 0, 0}]}, Boxed -> False,   PlotRange -> {{-1, 1}, {-1, 1}, {-1, 1}}] , {{x, 0, "degree"}, 0, 180, 0.1, Appearance -> "Labeled"}, TrackedSymbols :> {x}] 

Is this what you want? The rotation vector is fixed in this code. But can easily make it variable as well.

enter image description here

Manipulate[ Grid[{{Graphics3D[ GeometricTransformation[Cuboid[{-0.5, -0.5, -0.5}],   RotationTransform[x Degree, {1, 0, 0}]],   Boxed -> False,   PlotRange -> {{-1, 1}, {-1, 1}, {-1, 1}}]}} ], {{x, 0, "degree"}, 0, 180, 0.1, Appearance -> "Labeled"}, TrackedSymbols :> {x}] 

Is this what you want? The rotation vector is fixed in this code. But can easily make it variable as well.

enter image description here

Manipulate[ Graphics3D[   {{Yellow, Opacity[.05], Cuboid[{-0.5, -0.5, -0.5}]},  GeometricTransformation[Cuboid[{-0.5, -0.5, -0.5}], RotationTransform[x Degree, {1, 0, 0}]]}, Boxed -> False, PlotRange -> {{-1, 1}, {-1, 1}, {-1, 1}}] , {{x, 0, "degree"}, 0, 180, 0.1, Appearance -> "Labeled"}, TrackedSymbols :> {x}] 

You can also just use Rotate function

enter image description here

Manipulate[ Graphics3D[ {{Yellow, Opacity[.05], Cuboid[{-0.5, -0.5, -0.5}]}, Rotate[Cuboid[{-0.5, -0.5, -0.5}], x Degree, {0, 0, 1}, {0, 0, 0}]}, Boxed -> False,   PlotRange -> {{-1, 1}, {-1, 1}, {-1, 1}}] , {{x, 0, "degree"}, 0, 180, 0.1, Appearance -> "Labeled"}, TrackedSymbols :> {x}] 
Source Link
Nasser
  • 156.1k
  • 12
  • 173
  • 396

Is this what you want? The rotation vector is fixed in this code. But can easily make it variable as well.

enter image description here

Manipulate[ Grid[{{Graphics3D[ GeometricTransformation[Cuboid[{-0.5, -0.5, -0.5}], RotationTransform[x Degree, {1, 0, 0}]], Boxed -> False, PlotRange -> {{-1, 1}, {-1, 1}, {-1, 1}}]}} ], {{x, 0, "degree"}, 0, 180, 0.1, Appearance -> "Labeled"}, TrackedSymbols :> {x}]