PDA

View Full Version : Animate only one of two rectangles (quads)



marce
07-08-2009, 03:08 PM
Hello!

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?

MaxH
07-08-2009, 03:45 PM
Easiest way is probably to display the first rectangle, THEN call glTranslate, THEN display the second rectangle.

marce
07-08-2009, 03:57 PM
Thanks!

Solved it now.

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