animate loadShapes independently

Hi all, i've been fiddling with processing a lot to finish an interactive project, and this is the last part of it to make it work. Processing(.js) is really cool but for now i really am quite the noob at it so i really do appreciate all the help i can get! :)

I've got this script on MY TESTSITE:

Can't seem to solve two issues:

-rotate all loadShapes independently

-rotate all loadShapes along the axis of the gears

PShape a1;
PShape a2;
PShape a3;
PShape a4;    
void setup(){
  size(640, 480, OPENGL);
  frameRate(24);
  background(255);
  a1 = loadShape("sidesA1.obj");
  a2 = loadShape("sidesA2.obj");
  a3 = loadShape("sidesA3.obj");
  a4 = loadShape("sidesA4.obj");
}

void draw(){
  background(255);
  translate(width/2, height/2);
  rotateY(radians(0));
  rotateX(radians(-180));
//rotateZ(radians(90));

  scale(3.0);
  rotate(millis() * 0.001 * TWO_PI / 10, 0, 0, 0);

shape(a1);
shape(a2, 0, 0);
shape(a3, 0, 0);
shape(a4, 0, 0);

}

Comments

  • Take a look at pushMatrix().

  • thank you will do :)

  • pushpMatrix and popMatrix solved the independent rotation, rotating along the correct pivot point can't be solved (by me) with processing, so i'm gonna have to set each object the world origin in my 3d design program.

  • which 3d design program do you use pls?

Sign In or Register to comment.