Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: Selecting which obj to move

  1. #1
    Intern Newbie
    Join Date
    Mar 2002
    Location
    Hermoupolis
    Posts
    33

    Selecting which obj to move

    I want to have 2 moving objs in the project, but I want to move the one by one, how will I do that???
    SeeDAreW

  2. #2
    Intern Contributor
    Join Date
    Feb 2002
    Posts
    82

    Re: Selecting which obj to move

    Are you talking about ie., having the mouse click on one and drag it around, if so use OpenGl Selection in conjuction with the mouse coordinates. http://www.opengl.org/developers/cod...ffer#first_hit
    or if your talking about moving them independantly of each other just just gl(Push/Pop)Matrix;
    //First object
    glPushMatrix();
    glRotatef(blah,blah,blah,blah);
    glTranslatef(blah,blah,blah);
    //Draw stuff here
    glPopMatrix();
    //second object
    glPushMatrix();
    glRotatef(blah,blah,blah,blah);
    glTranslatef(blah,blah,blah);
    //Draw stuff here
    glPopMatrix();
    and so on....
    if these are not what you meant, please explain...
    The Chicken Fryer

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •