# Problem with combining Manipulate and ParametricPlot3D

I've beein trying to solve this problem but somehow I just can't combine Manipulate and ParametricPlot3D.

trobrid[g_, t_, a_, b_] := Module[{X, Y, Z, tang, norm, binorm, k, l},
g == {X[t], Y[t], Z[t]};
tang = D[g, t]/Simplify[Sqrt[D[g, t].D[g, t]]];
norm = D[tang, t]/Simplify[Sqrt[D[tang, t].D[tang, t]]];
binorm = FullSimplify[Cross[tang, norm], t > 0];
Manipulate[
ParametricPlot3D[g, {t, a, b}],
Graphics3D[{
Red, Arrow[{g, tang + g} /. {t -> s}],
Blue, Arrow[{g, norm + g} /. {t -> s}],
Purple, Arrow[{g, binorm + g} /. {t -> s}]
}], {s, a, b}]
]


This is the error:

Try this:

Clear[g, t, a, b, s, trobrid]
trobrid[g_, t_, a_, b_] := DynamicModule[
{X, Y, Z, tang, norm, binorm, k, l},
{X[t], Y[t], Z[t]} = g;
tang = D[g, t]/Simplify[Sqrt[D[g, t].D[g, t]]];
norm = D[tang, t]/Simplify[Sqrt[D[tang, t].D[tang, t]]];
binorm = FullSimplify[Cross[tang, norm], t > 0];

Manipulate[
Show[
ParametricPlot3D[g, {t, a, b}],
Graphics3D[
{Red, Arrow[{g, tang + g} /. {t -> s}], Blue,
Arrow[{g, norm + g} /. {t -> s}], Purple,
Arrow[{g, binorm + g} /. {t -> s}]}]
],
{s, a, b}
]
]


Then:

trobrid[{Cos[t], Sin[t], t/3}, t, 0, 3 Pi]


1. You should use DynamicModule with Manipulate, rather than Module.
2. g == {X[t], Y[t], Z[t]}; is incorrect as an assignment; you really want to assign {X[t], Y[t], Z[t]} to the existing value of g, so you want {X[t], Y[t], Z[t]} = g, and you want to use Set (=), not Equal (==).
3. You need to wrap your graphics objects in Show within Manipulate to combine them and show them superimposed.
• @zermelovac Oh! I misunderstood; that's fortunately an easier task :-) Try adding this inside your Graphics3D list of objects within the Manipulate: Inset[Style["s = " <> ToString@Round[s, 0.1], 28, Black], Scaled[{0.3, 0.2, 0}]]. See how it works, then you can use it as a template of sorts to roll your own. Mar 20, 2016 at 22:15