Results 1 to 10 of 10

Thread: OpenGL Texture Mapping [Equirectangular 2 Azimuthal Equidistant]

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Administrator Redrobes's Avatar
    Join Date
    Dec 2007
    Location
    England
    Posts
    7,201
    Blog Entries
    8

    Default

    OK thats old school GL. Now when you come to putting in the last row of texture coords then you need to ensure that the values your using in that last row are not the same as the first row even tho the vertex positions will be the same. I.e. if you have 11 points numbered in 0 to 10 inclusively then you would have pos[0] as 0, pos[1] as 1, pos[9] as 9 and then pos[10] as 0 so that it wraps around. But you need your texture coords to be tex[0] = 0, tex[1] = 1, tex[9] = 9, tex[10] = 10 and use GL_REPEAT.

    Maybe stack overflow would be better suited now. Its pretty hard to debug apps like this without being able to step it through. Now that you have a good idea what is going on it should be quite quick to see where its occurring and then to fix. If you get stuck then print out the position and the tex coord in a table and see if when it wraps your not using a wrapped tex coord too so that the interpolator thinks ok ill just run right back through the whole texture map back to 0 in that last face.

  2. #2

    Default

    Quote Originally Posted by Redrobes View Post
    Now when you come to putting in the last row of texture coords then you need to ensure that the values your using in that last row are not the same as the first row even tho the vertex positions will be the same.
    I don't think its quite that simple except in the polar aspects (image on left). From the image below you can see that the distortion is not always in the same location (image on right).

    This is why I used the method described in the video above. (Which only partially worked).

    Quote Originally Posted by Redrobes View Post
    Maybe stack overflow would be better suited now. Its pretty hard to debug apps like this without being able to step it through.
    I'm not sure what you mean by "stack overflow"; I thought this was a bad thing when you ran out of space on the stack?
    I've been writhing the algorithm section of my program in MATLAB first to give step by step visual cues. I was going to try outputing values to a file where I could analyse like you sugested
    FILE *fp= fopen("test.txt","w");
    Thanks for your help.
    Last edited by felixrulz; 07-29-2012 at 10:11 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
  •