Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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

1 Answer 1

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.