2
$\begingroup$

enter image description here

How to find the vertices of a regular tetrahedron? a dodecahedron?

I already get the coordinate of the tetrahedron, but i don't know how to rotate it just like the gif

$\endgroup$
2
$\begingroup$
tet = Tetrahedron[{{0, 0, 0}, {-(1/(2 Sqrt[3])), -(1/2), Sqrt[2/3]}, 
   {-(1/(2 Sqrt[3])), 1/2, Sqrt[2/3]}, {1/Sqrt[3], 0, Sqrt[2/3]}}]

frames = Table[Graphics3D[
    GeometricTransformation[{FaceForm[Opacity[.5, Blue], Opacity[.5, Yellow]], tet}, 
     RotationTransform[t 2 Pi, {0, 0, 1}, {0, 0, 0}]], 
    Lighting -> "Neutral", Boxed -> False, 
    PlotRange -> {{-1, 1}, {-1, 1}, {0, 1}}, 
    ViewPoint -> {3, 4, 1}], {t, -1, 1, .01}];

ListAnimate[frames]

enter image description here

To get some wobbling effect, you can use RotationTransform[t 2 Pi, {0, Abs[t]/5, 1}, {.1, .2, 0}] and use PlotRange -> {{-1, 1}, {-1, 1}, {-.1, 1}} 1.2:

enter image description here

Use Export["tets.gif", frames] to create an animated GIF file.

$\endgroup$
2
$\begingroup$

You can create a table of ViewPoint frames. The graphics option Viewpoint is the point in space where objects are viewed. For example I can create the polygon using the code above and then a table of the graphics with the viewpoint circling around a circle of radius 2 in the x-y plane:

 myAnimationFrames=Table[Show[myTetra,ViewPoint-> 
 {Re[2Exp[I t]],Im[2 Exp[I t]],0},PlotRange->2], 
 {t,0,2 \[Pi],0.2}];  

And then save it to a gif file:

 myAnimationName = NotebookDirectory[] <> 
 "myAnimationFile.gif";
 Export[myAnimationName, myAnimationFrames];
$\endgroup$

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.