   Sphere Texture mapping
  Dear All,I''m trying to texture map a sphere. I got a equation off this site(http://astronomy.swin.edu.au/pbourke/texture/spheremap/), that as far as I can tell is correct(works out exactly the same as on the site when I do the problem). However, when I use the code, there is a ring from the top of the sphere to the bottom, and the top and bottom are blank. Here is my code:texturev = acos(sphere.z) / PI ; if (normal.y >= 0) textureu = acos(sphere.x/(sin(PI*(texturev)))) / TWOPI;   elsetextureu= (PI + acos(sphere.x/(sin(PI*(texturev))))) / TWOPI;Anyone see what I''m doing wrong????Thanks,Jessewww.laeuchli.com/jesse/  </i>   
  Well, it took me quite some time to understand that code, but as it seems to me, it splits up the sphere into two parts (the if/else part) along the textureu coordinate. This way, the texture is split in the middle. The ring seems quite normal for me, then. If I get the code right, your texture must be similar on the left side and the left half, and on the right side and the right half. If you paint a 128x256 texture and then paste a copy of it right to it, the ring should disappear. Maybe it could also work if you change the else clause to:textureu = (TWOPI - acos(sphere……<br>And then only make the left and the right part of your texture the same.<br>But as what you said about the top and the bottom. What does your texture look like? The algorithm uses the _whole_ texture space for texturing. Dont just draw a sphere in your texture, you must fill the whole texture.  </i>   