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 3 of 3

Thread: Scrollbars relative to screen not coordinates

  1. #1
    Junior Member Newbie
    Join Date
    May 2002
    Location
    Dortmund, NRW, Germany
    Posts
    14

    Scrollbars relative to screen not coordinates

    Hi!
    First, I want to thank everyone for spending time reading and perhaps answering this.
    I´m having the following problem, which I´m trying to solve for weeks now:
    I read-in a 3d file and display it and want to view it from any side, any place at any scale. glRotate and glScale are working fine, yet I have two scrollbars, which are supposed to move the object to the left/right/up/down. But not in absolute coordinates (e.g. like always adding 1 to the x value) but relative to its current position on the screen.
    Example: I watch a building and click on "right" and the building moves to the right. Now I use glRotate and watch it from the other side, click on "right" and unluckily it moves to the left.
    Please help!

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Jun 2000
    Location
    Shreveport, LA, USA
    Posts
    1,757

    Re: Scrollbars relative to screen not coordinates

    When you rotate the building, you need to also rotate the right vector. The best way of doing this will depend upon the particular degrees of freedom you are using.

  3. #3
    Junior Member Regular Contributor
    Join Date
    Dec 2001
    Location
    Belmont, CA, USA
    Posts
    224

    Re: Scrollbars relative to screen not coordinates

    Perhaps you are calling glTranslate after glRotate? Try reversing them. Then the translate will be in the un-rotated coordinate system.

Posting Permissions

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