please format code with </> button * homework policy * asking questions
Hi, how can I translate and rotate object independetly?
I don’t want to translate the object after a translated object…
please format code with </> button * homework policy * asking questions
Hi, how can I translate and rotate object independetly?
I don’t want to translate the object after a translated object…
you can isolate the different objects by using
pushMatrix and popMatrix around the rotation of one object.
example
float angle;
void setup()
{
size( 800, 800, P3D );
noFill();
stroke(255, 2, 2);
} // setup
void draw()
{
background(0);
lights();
pushMatrix();
noFill();
stroke(255, 2, 2);
translate(width/2-100, height/2+100, 0);
rotateY(angle);
box(60);
angle+=.01;
popMatrix();
pushMatrix();
stroke(111);
fill(255, 2, 2);
translate(width/2+100, height/2+100, 0);
rotateX(angle);
box(60);
angle+=.01;
popMatrix();
} // draw