Results 1 to 3 of 3

Thread: zooming, picking examples

  1. #1
    Guest

    zooming, picking examples

    Yesterday's thread on 2D zooming points out that a basic part of many projects is zooming, rubber-banding, picking and scrolling but I cannot find any good code examples(both linux and windows) of a project that includes all these and the openGL books are useless for such a real-life project. Are there any good examples of this out there ?

    Here is a typical case:
    1) glViewport is set to size of window (ie QGLWidget)
    2) glortho set to the size of the image - if glviewpoint is smaller size, then scrollbars are needed, else if viewport set to a larger or same size, then no scrollbars.
    3) zoom with a rubber band to only a small portion of the photo - determine new scale by ratio of zoombox to glortho
    4) set glScale to new scale factor, expand glOrtho to scaled up size
    5) now mouse pick uses glunproject to get world coordinate
    Is this the best way ?

  2. #2
    Senior Member Frequent Contributor plasmonster's Avatar
    Join Date
    Mar 2004
    Posts
    739

    Re: zooming, picking examples

    That seems reasonable. Though, there is seldom a "best way" for anything. Experimentation is key.

    As for examples, try a google for existing open source editors out there. There are literally hundreds of them. For example, many of the quake editors are open source. Most any 3D editor out there will have this kind of functionality built into it.

  3. #3
    Guest

    Re: zooming, picking examples

    True, but like finding needle in a haystack.

    >>As for examples, try a google for existing open >>source editors out there. There are literally >>hundreds of them. For example, many of the quake >>editors are open source. Most any 3D editor out >>there will have this kind of functionality built >>into it.

Similar Threads

  1. Any examples of object picking with Vulkan
    By AndySomogyi in forum Vulkan
    Replies: 1
    Last Post: 10-05-2018, 05:51 AM
  2. Z-buffer picking, gluUnProject picking not working
    By Icetigris in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 07-29-2008, 10:38 AM
  3. Zooming out
    By Canadian0469 in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 05-19-2008, 01:01 PM
  4. zooming
    By in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 08-14-2002, 10:47 PM
  5. Zooming
    By KurtCob in forum OpenGL: Advanced Coding
    Replies: 5
    Last Post: 09-18-2000, 05:26 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
  •  
Proudly hosted by Digital Ocean