Results 1 to 4 of 4

Thread: why

  1. #1
    Guest

    why

    ReadJPEG("1.jpg", &pixels, &w, &h, &c);


    after i readin the image, why is it upside down? how can i flip it to normal view version? how can i flip it vertically and horizontally? thanks for helping.

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    2,978

    Re: why

    How do you use it, and how do you know it's up side down? It can be your code that draws the image in the wrong way, or are you completely sure that this one is correct?

    One possible way can be that if you use it as a texture, make sure you have the origin in the right place. In OpenGL, the origin is in the lower left corner, and not the upper left as one would think.

    [This message has been edited by Bob (edited 03-03-2001).]

  3. #3
    Senior Member OpenGL Pro
    Join Date
    Oct 2000
    Location
    Fargo, ND
    Posts
    1,753

    Re: why

    If you do need to flip the data, you simply need to do a pair of nested for loops that swaps the pixels from start to end. If you're not sure how to do this, I'd suggest learning C/C++ better before jumping into OpenGL.
    Deiussum
    Software Engineer and OpenGL enthusiast

  4. #4
    Guest

    Re: why

    why dont you just draw it upside down....
    (or right side up in this case)

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