Part of the Khronos Group

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: 2d opengl application and picking

  1. #1
    Junior Member Regular Contributor
    Join Date
    Apr 2010

    2d opengl application and picking

    I must do a 2d editor with opengl.
    I must have a panel with a texture that occupy all the screen and over this panel i must draw line and a disk(a filled 2d circle).
    I wish draw the panel at z = 0 and the lines and disk at z = 0.2 or 0.3.
    may be is a good solution?
    or there is a better solution?
    and for the picking ?
    what sense have a ray in a 2d application?

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Jan 2012
    What you sugest sounds fine.

    For 2D drawing you could disable depth testing (GL_DEPTH_TEST) then set all z-value to 0 - this will then draw like a normal GDI windows.

    What are you picking? If it is the line gluunproject will probably struggle so I would simply use cpu caclulations (if that is allowed - I is assume this is some sort of assignment)

Posting Permissions

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