Results 1 to 6 of 6

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

  1. #1
    Senior Member Regular Contributor
    Join Date
    Sep 2002
    Location
    Nanjing,China
    Posts
    116

    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
    Senior Member Frequent Contributor
    Join Date
    Aug 2001
    Location
    Italy
    Posts
    625

    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
    Senior Member Regular Contributor
    Join Date
    Sep 2002
    Location
    Nanjing,China
    Posts
    116

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

    Great Input,Thanx a lot.

  4. #4
    Senior Member Regular Contributor
    Join Date
    Jun 2002
    Posts
    365

    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
    Senior Member Frequent Contributor
    Join Date
    Apr 2000
    Location
    Adelaide, South Australia, Australia
    Posts
    763

    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
    Member 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

Similar Threads

  1. Divide by zero
    By V-man in forum OpenGL: Advanced Coding
    Replies: 5
    Last Post: 02-06-2013, 07:46 AM
  2. Divide by zero
    By dukey in forum OpenGL: GLSL
    Replies: 2
    Last Post: 12-30-2010, 11:09 AM
  3. Divide the code
    By Aquileo in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 12-04-2003, 06:13 AM
  4. "divide by zero" when using light
    By skorman00 in forum OpenGL: Basic Coding
    Replies: 9
    Last Post: 06-13-2003, 12:37 PM

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