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

Thread: Image Rotation with 1 degree precision using OpenGL

  1. #1
    Junior Member Newbie
    Join Date
    Jun 2013
    Posts
    9

    Question Image Rotation with 1 degree precision using OpenGL

    i want to rotate an BMP image/ image Buffer with 1 degree precision in z-axis(Width & Height wont get changed) only by using OpenGL and i want to Export the Rotated image & save it as a BMP file.

    I tried to render that image by using OpenGL functions by applying this image as a texture to a QUAD & i'm able to rotate & render this image in desired direction. But now i want to export this rotated image.

    Could anyone please tell me is it possible by using standard functions in OpenGL?

    Or else please suggest any links regarding this.

    Thank you

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Apr 2010
    Location
    Germany
    Posts
    1,128
    EDIT: Ah well, glReadPixels is probably good.
    Last edited by thokra; 06-19-2013 at 01:58 AM.

  3. #3
    Member Regular Contributor
    Join Date
    Jun 2013
    Posts
    490
    Quote Originally Posted by Balaji_mcr View Post
    But now i want to export this rotated image.
    glReadPixels

  4. #4
    Junior Member Regular Contributor
    Join Date
    Apr 2012
    Location
    Los Angeles
    Posts
    177
    Quote Originally Posted by Balaji_mcr View Post
    ... and i want to Export the Rotated image & save it as a BMP file.
    Could anyone please tell me is it possible by using standard functions in OpenGL?
    As others have said use 'glReadPixels' to read your new image into an array. Exporting that array as a .bmp file is not something that OpenGL does. You'll have to Google a phrase like 'OpenGL .bmp export' to get some code to do the export step. There's lots of free software that will do this for you. I do what are trying to do all the time in my OpenGL simulations. In fact I export 100's, even 1000's of images into a folder for compression into Quicktime movies. Each image sequence has names like b_0001.bmp, b_0002.bmp, .... etc.

    Good luck.

Posting Permissions

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