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

Thread: how can we divide window into subregions just like milkshape3d does

  1. #1
    Junior Member Regular Contributor
    Join Date
    Sep 2002
    Location
    Nanjing,China
    Posts
    118

    how can we divide window into subregions just like milkshape3d does

    Does anybody has idea how to implement Milkshape3d -style split window with each sub-section in which x,y,z axis pointing to the screen.I am left wondering how can i do it myselves after i use Milkshape 3d which is my first ever-used 3d modeling tool.

    I know from Red Book that glScissor might work.but i don't know how to perform the different projection to the whold screen?

    It would be great if any one could privide some code or pointing to a link,Thanx a lot.




    [This message has been edited by RunningRabbit (edited 07-14-2003).]

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Aug 2001
    Location
    Italy
    Posts
    628

    Re: how can we divide window into subregions just like milkshape3d does

    Do glViewport, set Scissor accordingly (this is optional).
    Set your modelview matrix.
    Draw.

    Repeat foreach region of window.

    Caveat: Clear* ops still takes up the whole screen so if you have no hints about what's happening... it will be a real problem!
    If you hard-code everything, which is probably what's happening, you may simply know that you are writing to subregion X and act as conseguence (skip clears, do it once for all window regions etc).

    Nvidia has a fog comparation demo which uses multiple wiewports in a single window. Try search for it, I think it would be useful.
    The anisotropic filtering demo also got multiple viewports.

  3. #3
    Junior Member Regular Contributor
    Join Date
    Sep 2002
    Location
    Nanjing,China
    Posts
    118

    Re: how can we divide window into subregions just like milkshape3d does

    Great Input,Thanx a lot.

  4. #4
    Member Regular Contributor
    Join Date
    Jun 2002
    Posts
    371

    Re: how can we divide window into subregions just like milkshape3d does

    Originally posted by Obli:

    Caveat: Clear* ops still takes up the whole screen so if you have no hints about what's happening
    Clear is affected by the scissor test. If you only need to clear a small region of the window, use scissor.

    From the api doc:

    The pixel ownership test, the scissor test, dithering, and the buffer writemasks affect the operation of glClear.

  5. #5
    Advanced Member Frequent Contributor
    Join Date
    Apr 2000
    Location
    Adelaide, South Australia, Australia
    Posts
    839

    Re: how can we divide window into subregions just like milkshape3d does

    Do glViewport, set Scissor accordingly (this is optional).
    scissor is always necessary. Further to the comment about scissor and clearing, you NEED scissor to clip fragments that project to outside the viewport region. There is no guarantee that fragments will be clipped even if they do not map to the region defined by viewport unless you enforce the clipping with scissor. So, scissor is always required even if you think you don't need it for masking out clearing.

    cheers,
    John

  6. #6
    Intern Contributor
    Join Date
    Jan 2001
    Location
    Irving TX USA
    Posts
    58

    Re: how can we divide window into subregions just like milkshape3d does

    MFC does this fairly easily as well, but if you use 4 different openGL contexts you'll need to read up on wglShareList, wglCreateContext et al.

    The CChildFrame object has a method called I think CreateSplitter where you can create a 4-pane splitter window, then you can put 4 different view objects in each window. I have a code sample for a modeling tool I'm working on that does that, you can look at the CChildFrame class if you want.
    http://daltxcoltsfan.tripod.com/OpenGL/OpenGL.htm

Posting Permissions

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