Rotate, translate, scale of 3D objects
Sándor Kabai
This is to show how 3D objects are to be rotated, translated and scaled.
This is to show how 3D objects are to be rotated, translated and scaled.
In[]:=
Manipulate[Module[{cub,axisx,axisy,axisz,textx,texty,textz},cub=Translate[PolyhedronData["Cube","Faces"],{0.5,0.5,0.5}];axisx={Red,Thick,Line[{{-2,0,0},{2,0,0}}]};axisy={Green,Thick,Line[{{0,-2,0},{0,2.5,0}}]};axisz={Blue,Thick,Line[{{0,0,-2},{0,0,2}}]};textx=Text[axisx,{2,0,0}];texty=Text[axisy,{0,2.7,0}];textz=Text[axisz,{0,0,2.2}];Graphics3D[{Rotate[Rotate[Rotate[Translate[Scale[{cub},{scalex1.618,scaley,scalez0.618},{0,0,0}],{transx,transy,transz}],rotx,{1,0,0}],roty,{0,1,0}],rotz,{0,0,1}],axisx,axisy,axisz,textx,texty,textz},BoxedFalse,SphericalRegionTrue,PlotRange2.6,ViewAngle0.23]],{{scalex,1,"scale x"},0.618,1,ImageSizeTiny},{{scaley,1,"scale y"},1,1.5,ImageSizeTiny},{{scalez,1,"scale z"},1,1.5,ImageSizeTiny},Delimiter,{{transx,0,"translate x"},-0.5,0.5,ImageSizeTiny},{{transy,0,"translate y"},-0.5,0.5,ImageSizeTiny},{{transz,0,"translate z"},-0.5,0.5,ImageSizeTiny},Delimiter,{{rotx,0,"rotate x"},0,2Pi,ImageSizeTiny},{{roty,0,"rotate y"},0,2Pi,ImageSizeTiny},{{rotz,0,"rotate z"},0,2Pi,ImageSizeTiny},TrackedSymbols{rotx,roty,rotz,scalex,scaley,scalez,transx,transy,transz}]
Out[]=

