Results 1 to 3 of 3

Thread: how can Irotate a specific area in opengl? glLoadMatrix

  1. #1
    Junior Member
    Join Date
    Dec 2008
    Posts
    1

    how can Irotate a specific area in opengl? glLoadMatrix

    Hi,

    I'm beggining to learn opengl and i have drawn a polygon consisting in several polygons, and now I want to know how can I rotate a single area in my polygon. I think I have to use glPushMatrix(), then glLoadMatrix and in this matrix i need to have the points that I want rotated. I have the points in world coordinates but don't know what to put in the glLoadMatrix. or even if this is the way to do it. please help

    thank you

  2. #2
    Senior Member
    Join Date
    May 2008
    Posts
    100

    Re: how can Irotate a specific area in opengl? glLoadMatrix

    Generally, the simplest way to do a rotation is to use glPushMatrix(), perform some transformations, draw, glPopMatrix(). This ensure that only the the items drawn in-between the push/pop will be affected by the transformations. For more complex animation, you can nest glPushMatrix()/glPopMatrix() calls to apply transformation in a hierarchy for things like joints in a skeleton.

  3. #3
    Junior Member
    Join Date
    Nov 2008
    Posts
    8

    Re: how can Irotate a specific area in opengl? glLoadMatrix

    Take a look at glRotate. I think it does what you want.

    See
    http://www.opengl.org/sdk/docs/man/xhtml/glRotate.xml
    or
    http://www.opengl.org/sdk/docs/man/

    -Acorn
    -Acorn
    (Opinions are my own, and not necessarily shared by my company or others.)

Similar Threads

  1. Replies: 8
    Last Post: 04-04-2010, 07:35 AM
  2. problem at using function glLoadMatrix
    By freesui1984 in forum OpenGL ES general technical discussions
    Replies: 2
    Last Post: 03-14-2008, 01:05 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
  •