0
$\begingroup$

I want to make a 3D shape move through a specified graph; e.g. y = Sin[x], such that it moves up and down.
My working so far has been to use Manipulate, and I think I want to use it with 'steps', as in the documentation, second one down, although I don't know how to use this.
Would this be the way, and if so how do I use it?

Here is what I have so far:

Manipulate[Graphics3D[{Green, Cuboid[{0, 0, t}], Blue, Cuboid[{0, 0, 0}]}], {t, 0, 3}]

I think I want something like:

Manipulate[ Graphics3D[{Green, Cuboid[{0, 0, t}], Blue, Cuboid[{0, 0, 0}]}],
            {t, 0, 3, y = Sin[x]}]
$\endgroup$

1 Answer 1

1
$\begingroup$

Something along these lines? Just want to make sure. Hard to put in the comment. If not will delete.

enter image description here

Manipulate[
 Graphics3D[{Green, Cuboid[{t, 0, Sin[t]}]},
  Axes -> True, PlotRange -> {{-2 Pi , 2 Pi}, {-1, 1}, {-2, 2}}
  ],
 {t, -2 Pi, 2 Pi, .1}]
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.