0
$\begingroup$

I have a 3D MeshRegion region1 as below:

region1 = MeshRegion[{{0, 0, 0}, {2, 0, 0}, {2, 2, 0}, {0, 2, 0}, {1, 1, 
2}}, {Tetrahedron[{1, 2, 3, 5}], Tetrahedron[{1, 3, 4, 5}]}]

I want to display region1 in a way that it will rotate automatically. What are the good ways to do so?

many thanks!

$\endgroup$
  • $\begingroup$ I am not clear as to what you mean by automatically. Manipulate[ TransformedRegion[region1, RotationTransform[theta, {1, 1, 1}]], {theta, 0, 2 Pi}] will rotate your shape about the {1,1,1} axis. $\endgroup$ – Tim Laska Oct 13 at 23:03
2
$\begingroup$

Using Animate:

Animate[With[{v = RotationTransform[\[Theta], {0, 0, 1}][{4, 0, 1}]}, 
  Show[{region1}, SphericalRegion -> True, ViewPoint -> v, 
   Method -> {"ShrinkWrap" -> False}]], {\[Theta], 0, 2 Pi}]

Using Dynamic:

Dynamic[Show[{region1}, 
  ViewPoint -> 
   RotationTransform[Clock[{0, 2 Pi}, 10], {0, 0, 1}][{4, 0, 1}], 
  Method -> {"ShrinkWrap" -> False}, SphericalRegion -> True]]
$\endgroup$
  • $\begingroup$ Thanks. Which of them requires lower computational cost? $\endgroup$ – H42 Oct 17 at 23:17
  • $\begingroup$ maybe the second one, but you can't stop it though.. $\endgroup$ – halmir Oct 18 at 3:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.