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

Thread: Rotate and read back

  1. #1
    Junior Member Newbie
    Join Date
    Jan 2009
    Posts
    5

    Rotate and read back

    Is there a way to map a texture to a quad, rotate the quad and read back the rotated image to perform collision detection on the rotated image. Currently I am detecting collision between the rectangles of two objects then comparing the pixels of the two image files. But to perform rotations I would have to create pre-rotated image files for every sprite that is rotated.

    Can't re-read the rotated image from the screen because there is a background under the images, and glReadPixels is way to slow.

    Any idea's would be appreciated.
    Reading about PBO's, but the only example I can find reads the whole framebuffer back.

  2. #2
    Senior Member OpenGL Guru
    Join Date
    May 2009
    Posts
    4,726

    Re: Rotate and read back

    But to perform rotations I would have to create pre-rotated image files for every sprite that is rotated.
    Or you could just rotate it yourself, on the CPU.

    Rendering and doing readback for something this trivial is almost certainly going to be slower than just doing a CPU-based test.

    Can't re-read the rotated image from the screen because there is a background under the images, and glReadPixels is way to slow.
    There's no other way to read data back than glReadPixels. That's what it's for.

Posting Permissions

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