Results 1 to 10 of 10

Thread: OpenGL Texture Mapping [Equirectangular 2 Azimuthal Equidistant]

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2

    Default

    Ok, so I think I have solved most of the mapping problems. I ended up using the method derived by T.I here: http://somedayspace.blogspot.com.au/...ction-and.html.

    After testing formulas in MALTAB I got promising results:


    I then converted to a function in C and tested. I seem to be very close now; there is just some detracting distortion where the image is joined along the date line:


    I the problem (at least I think) is due to the wrapping of texture coordinates. I have tried to illustrate the problem in the figure below. The program is currently mapping from A-->B so the sector has a compressed version of nearly the entire map; what we want is to map from A to the right wrapping to B. In OpenGL I think this can be achieved by enabling GL_REPEAT and simple using that B'=B+1 to get the correct texture response.


    I added a check:
    Code:
    if (p_d[n].u < p_d[n-1].u)
            p_d[n].u += 1;
    but this only fixed them problem from one of the polar aspects.

    Let me know if you have any ideas on hot to fix this. Here is a link to the program I have so far: http://dl.dropbox.com/u/49415695/Des...ry.close%5D.7z if it helps diagnose (or if you just want a look).
    You will need the data folder with the image (and maybe some dll files I haven't included). The arrow keys control the centre of the projection, 't' toggles the texture, 'up-pg' 'dn-pg' zoom in and out.
    Last edited by felixrulz; 07-26-2012 at 10:01 PM.

Posting Permissions

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