Results 1 to 3 of 3

Thread: View Box Coords?

  1. #1
    Senior Member Regular Contributor nickels's Avatar
    Join Date
    Feb 2000
    Location
    Colorado
    Posts
    284

    View Box Coords?

    I am doing some view box culling. These are my steps:

    -setup PROJECTION matrix
    -setup MODELVIEW matrix

    -get projection & modelview matrices from opengl. Multiply.

    -Project the coords of the bounding box using this matrix.

    -Test whether the projected point will be mapped to the screen or not. (*)

    Opengl will take this coord and map it into window coords.

    My question is:
    What coords at * should I test for. It appears -1 < x < 1 and -1<y<1 are correct. What about the z coord?
    What projected coords are mapped into the viewport?
    Does this depend on the projection? (I really dont think it does).

    Thanks.

  2. #2
    Junior Member Newbie
    Join Date
    Feb 2000
    Posts
    17

    Re: View Box Coords?

    Are you exectly "project" or "rotate and translate" yours box by multiply it on Projection-ModelView Matrix. If you project yours box, than you lose z-coordinate. May be you should try not plane clipping (test x and y coords of projected object), try volume clipping - test x, y and z coords of object, after rotation and translation, in yours view frustum.

    Yours, Mad Max.

    [This message has been edited by Mad Max (edited 02-23-2000).]

  3. #3
    Senior Member Regular Contributor nickels's Avatar
    Join Date
    Feb 2000
    Location
    Colorado
    Posts
    284

    Re: View Box Coords?

    The only z case that I care about is if a whole ton of triangles are behind me. Then they will pass the x y tests, but I don't want to send all the verticies through the pipeline. I want to zap them dead from the start. Does not the projection matrix keep the z for depth buffering? I thought the z coord was projection into 0-1 space with relative distances maintained? I guess I need to sit down and start projecting things back and forth and analyze the results.

Similar Threads

  1. unable to translate from screen coords to world coords
    By etiennecouturie in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 04-28-2014, 06:04 AM
  2. Depth problem with translating screen coords to world coords
    By Bryan_dup1 in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 04-13-2006, 05:02 AM
  3. Converting drawable coords to viewport coords
    By Dean Edmonds in forum OpenGL: macOS
    Replies: 2
    Last Post: 01-20-2006, 05:41 AM
  4. Move view to big coords
    By Lanstorp in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 07-23-2002, 01:45 PM
  5. View coords to world coords problem
    By NoAntz in forum OpenGL: Advanced Coding
    Replies: 0
    Last Post: 02-19-2002, 03:33 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