public void mover2d( int posx , int posy){
parent.pushMatrix();
Cilindro((ancho_casilla-4), 40, 20);
parent.translate(posx,posy);
parent.popMatrix();
}
public void mover3d (int posx, int posy, int posz){
parent.pushMatrix();
parent.translate(posx,posy,posz);
parent.popMatrix();
}
public void dibujar(){
Cilindro((ancho_casilla-4), 40, 20);
}
public void rotar(){
parent.pushMatrix();
parent.rotateX(4.7F);
parent.popMatrix();
}
And then I do something like that in my draw() function on the main class:
The thing that I want to know is why all works fine except all the callings to the pushMatrix(), translate senteces from inside the class methods,etc. Does anyone know why it happens that?