Framed[
Manipulate[
Show[
Graphics3D[
(*Objects*)
{CapForm[None],
Opacity[0.7],
Blue,Tube[{{0,0,0},{0,0,5}},2.1],
Opacity[1.0],
Green,Cylinder[{{0,0,cylZ+4.5},{0,0,cylZ-0.8}},2],
Darker[Green],PointSize[0.02],Point[{cylZ+8,0,Cos[2*cylZ]+2}],
(* graph lines for point - T E M P O R A R Y *)
Thin,Black,
Line[{{4,0,1},{9,0,1}}],
Line[{{4,0,5},{4,0,1}}]
}
],
(* Plot setup *)
Axes->True,
AxesStyle->{Red,Green,Blue},
PlotRange->{{-3,10},{-3,8},{-5,9}},
(* Camera setup*)
ViewPoint->{dx,dy,dz}
],
Style["Cylinder and Piston Demo",18,Bold],
"",
Delimiter,
"","",
Style["Cylinder movement",14,Bold],
(* Variables *)
{{cylZ,-0.1},-3,0}, (* Cylinder movement *)
"",
Style["Camera controls",14,Bold],
{{dx,0.1},-4,4},{{dy,-4},-4,4},{{dz,1},-4,4} ,(* Camera viewPoint *)
ControlPlacement-> Left,
Paneled -> False,
AutorunSequencing->{1}
],FrameMargins->30,FrameStyle-> LightGray
]