moving objects
in
Programming Questions
•
2 years ago
Hi All,
I am trying to move an object with translate but at the same time I want to show the previous position of such object (kind of tracking history). I usually do this by deleting the background but in this case if I do so then the 3D navigation o crazy for obvious reasons. Do you know another way I can still show the prev position of an object using a background at the same time?
- import peasy.*;
- PeasyCam cam;
- int t =0;
- void setup() {
- size(600,600,P3D);
- cam = new PeasyCam(this, 0);
- cam.setMinimumDistance(200);
- cam.setMaximumDistance(1000);
- frameRate(5);
- }
- void draw() {
- lights();
- // rotateX(-.5);
- // rotateY(-.5);
- background(0);
- fill(255,0,0);
- // box(30);
- box(10);
- pushMatrix();
- t+=10;
- translate(0,t,0);
- fill(0,0,255);
- box(10);
- popMatrix();
- }
1