Results 1 to 3 of 3

Thread: Animate only one of two rectangles (quads)

  1. #1
    Member Newbie
    Join Date
    Jul 2009
    Posts
    33

    Animate only one of two rectangles (quads)

    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
    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?

  2. #2
    Senior Member Regular Contributor
    Join Date
    Mar 2003
    Location
    Los Angeles
    Posts
    374

    Re: Animate only one of two rectangles (quads)

    Easiest way is probably to display the first rectangle, THEN call glTranslate, THEN display the second rectangle.
    Am I doing your homework for you?

  3. #3
    Member Newbie
    Join Date
    Jul 2009
    Posts
    33

    Re: Animate only one of two rectangles (quads)

    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 ?

Similar Threads

  1. Rectangles don't have the same size
    By Lumanior in forum OpenGL: Basic Coding
    Replies: 13
    Last Post: 03-16-2011, 02:44 AM
  2. Overlapping Rectangles
    By gh001 in forum OpenGL: Basic Coding
    Replies: 6
    Last Post: 03-01-2008, 10:55 AM
  3. Rectangles appear as triangles
    By in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 08-10-2005, 02:15 PM
  4. Drawing rectangles
    By gator in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 02-08-2003, 08:27 PM
  5. 3d rectangles
    By aap9 in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 10-22-2001, 12:49 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean