Animate only one of two rectangles (quads)


I have painted two rectangles (QUADS) and I would like to move one of these on the X axis.

I have succeded with the movement by changing the variable “move” in the below code

gl.glTranslatef(move, this.y, this.z);

But then both rectangles are moved. I would like to move only one of them. How can I do that?

Easiest way is probably to display the first rectangle, THEN call glTranslate, THEN display the second rectangle.


Solved it now.

Another question, how do a put a rectancle so it appears at the right top at X=0 and Y=0 ?