WOLFRAM|DEMONSTRATIONS PROJECT

Randomize Motion for Six Degrees of Freedom

Manipulate[​​SeedRandom[seed];​​{x,y,z,Rx,Ry,Rz}=If[random,iDot[DiagonalMatrix[RandomInteger[{1,0},{6}]],Join[RandomReal[(7/180){-1,1},{3}],RandomReal[.5{-1,1},{3}]]],{x,y,z,Rx,Ry,Rz}];​​Graphics3D[{If[n3,{},ground],If[co,coordinate,{}],EdgeForm[GrayLevel[.3]],​​Translate[Rotate[Rotate[Rotate[model[[n]],Rx°,{1,0,0}],Ry°,{0,1,0}],Rz°,{0,0,1}],{x,y,z}]},​​Axesco,Boxedbox,ImageSize{400,400},Lightingn/.{1Automatic,2None,3"Neutral"},PlotRange10.5,ViewPointview/.Thread[Rule[{"default","above","back","right","below","front","left"},points]]],​​{{n,3,"model"},{1"cuboid",2"ball",3"space shuttle"},ControlTypePopupMenu},​​Delimiter,​​{{view,"default","view"},{"default","above","back","right","below","front","left"},ControlTypePopupMenu},​​{{box,False,"boxed"},{True,False},ControlTypeCheckbox},​​{{co,False,"coordinate"},{True,False},ControlTypeCheckbox},​​Delimiter,"degree of freedom",​​{{x,0,"x"},-7,7,.1,ImageSizeSmall,Enabled!random},​​{{y,0,"y"},-7,7,.1,ImageSizeSmall,Enabled!random},​​{{z,0,"z"},-7,7,.1,ImageSizeSmall,Enabled!random},​​{{Rx,0,"Rx"},-180,180,1,ImageSizeSmall,Enabled!random},​​{{Ry,90,"Ry"},-180,180,1,ImageSizeSmall,Enabled!random},​​{{Rz,0,"Rz"},-180,180,1,ImageSizeSmall,Enabled!random},​​Delimiter,​​{{random,False,"randomize"},{True,False},ControlTypeCheckbox},​​{{seed,1,"seed"},1,1234,1,ImageSizeSmall},​​{{i,-180,"start"},-180,180,1,AnimationRepetitions2,ControlTypeTrigger},​​ControlPlacementLeft,TrackedSymbolsTrue,​​Initialization(​​ngons=Union[Flatten[Map[First,PolyhedronData["Archimedean","FaceCountRules"],{2}]]];​​colors={White,White,Black,White};​​ball=Normal[PolyhedronData["TruncatedIcosahedron","Faces"]]/.Polygon[x_]{Glow[colors[[Position[ngons,Length[x]][[1,1]]]]],Polygon[x]};​​spaceShuttle=Scale[ExampleData[{"Geometry3D","SpaceShuttle"},"GraphicsComplex"],.75];​​model={Cuboid[{-3,-2,-1},{3,2,1}],ball,spaceShuttle};​​ground={Opacity[.3],Green,Polygon[10{{-1,-1,-1},{-1,1,-1},{1,1,-1},{1,-1,-1}}]};​​coordinate={Text[Style[#〚1〛,Italic],#〚2〛]&/@Transpose[{{"x","y","z"},5IdentityMatrix[3]}],​​Red,Sphere[{0,0,0},.2],Gray,Arrowheads[.015],Arrow[{{0,0,0},#}]&/@(4IdentityMatrix[3])};​​points=Prepend[Flatten[Outer[Times,{1,-1},Permutations[{0,0,Infinity}]],1],{2,-2,1}];​​)]
​
model
space shuttle
view
default
boxed
coordinate
degree of freedom
x
y
z
Rx
Ry
Rz
randomize
seed
start
Installing data from Wolfram Research data server ​
RoundFailure

Reason: Which
Tag: SecurityViolation
!MissingNotAvailable,MissingNotAvailable,MissingNotAvailable,
Failure

Reason: AsynchronousTaskObject
Tag: SecurityViolation
[http://pacletserver.wolfram.com/Paclets/ExampleData_Geometry3D-11.0.0.3.paclet,1,16519867951302095654]||
MissingNotAvailable,MissingNotAvailable,Failure

Reason: AsynchronousTaskObject
Tag: SecurityViolation
[http://pacletserver.wolfram.com/Paclets/ExampleData_Geometry3D-11.0.0.3.paclet,1,
16519867951302095654]<0,0,0≤MissingNotAvailable,MissingNotAvailable,
Failure

Reason: AsynchronousTaskObject
Tag: SecurityViolation
[http://pacletserver.wolfram.com/Paclets/ExampleData_Geometry3D-11.0.0.3.paclet,1,16519867951302095654]≤1,100
MissingNotAvailable,MissingNotAvailable,Failure

Reason: AsynchronousTaskObject
Tag: SecurityViolation
[http://pacletserver.wolfram.com/Paclets/ExampleData_Geometry3D-11.0.0.3.paclet,1,
16519867951302095654],True,100
%.
Installing data from Wolfram Research data server ​
RoundFailure

Reason: Which
Tag: SecurityViolation
!MissingNotAvailable,MissingNotAvailable,MissingNotAvailable,
Failure

Reason: AsynchronousTaskObject
Tag: SecurityViolation
[http://pacletserver.wolfram.com/Paclets/ExampleData_Geometry3D-11.0.0.3.paclet,11,33596164167975192026]||
MissingNotAvailable,MissingNotAvailable,Failure

Reason: AsynchronousTaskObject
Tag: SecurityViolation
[http://pacletserver.wolfram.com/Paclets/ExampleData_Geometry3D-11.0.0.3.paclet,11,
33596164167975192026]<0,0,0≤MissingNotAvailable,MissingNotAvailable,
Failure

Reason: AsynchronousTaskObject
Tag: SecurityViolation
[http://pacletserver.wolfram.com/Paclets/ExampleData_Geometry3D-11.0.0.3.paclet,11,33596164167975192026]≤1,100
MissingNotAvailable,MissingNotAvailable,Failure

Reason: AsynchronousTaskObject
Tag: SecurityViolation
[http://pacletserver.wolfram.com/Paclets/ExampleData_Geometry3D-11.0.0.3.paclet,11,
33596164167975192026],True,100
%.
Six degrees of freedom (6DoF) refers to six independent motions of a rigid body in 3D space. They consist of three translations along the
x
,
y
, and
z
axes and three rotations around those axes,
R
x
,
R
y
, and
R
z
. 6DoF is a fundamental concept for mechanical, aeronautical, and robotics engineering. This Demonstration lets you interactively control a model with 6DoF, or you can choose the randomize option to visualize motion with multiple DoF combinations. (Select the "randomize" checkbox to toggle between random and manual control mode. )