Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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]}]
share|improve this question
up vote 1 down vote accepted

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}]
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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