-
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!
-
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.
-
Junior Member
Regular Contributor
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
-
Forum Rules