Thread: glRotate

  1. #1
    ~viaxd() viaxd's Avatar
    Join Date
    Aug 2003
    Posts
    246

    glRotate

    hi,
    what i have is a quad that looks like an arrow:
    Code:
    	glBegin(GL_QUADS);
    	glTexCoord2f(0.0f, 0.0f);
    	glVertex3f(-1.0f, 1.0f, 0.0f);
    
    	glTexCoord2f(1.0f, 0.0f);
    	glVertex3f(-0.5f, 0.5f, 0.0f);
    
    	glTexCoord2f(1.0f, 1.0f);
    	glVertex3f(-1.0f, 0.0f, 0.0f);
    
        glTexCoord2f(0.0f, 1.0f);
    	glVertex3f(1.0f,  0.5f, 0.0f);
    	glEnd();
    if i do glRotatef(a, 1.0f, 0.0f, 0.0f); it rotates around the lower left vertex, that is the lower left never moves. how do i make it rotate around the center?
    :wq

  2. #2
    ---
    Join Date
    May 2004
    Posts
    1,379
    Translate the cube to the centre of the screen before calling glRotatef

  3. #3
    ~viaxd() viaxd's Avatar
    Join Date
    Aug 2003
    Posts
    246
    thanks. figured it out
    :wq

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. looking and moving up and down(pitch) using glRotate()
    By Crossbow in forum Game Programming
    Replies: 3
    Last Post: 06-15-2002, 12:17 AM