0
\$\begingroup\$

Right now I'm texturing the octahedron with the formular from wikipedia(Finding UV on a sphere): UV Coordinates Wikipedia

That unfortunately leads to heavy distortion right at the beginning, which of course leads to a lot of distortion when splitting up the triangles when approximating it to a sphere.

The upper and lower triangles are okay, the left and right ones are distorted. Now I'm looking for different formulars to calculate the uv's. Are there any other easy formulars? Or would another approach be much more complicated?

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

The Wikipedia entry you cite is correct - your image shows the characteristic pattern (the stripes) that indicates one of your calculations that is supposed to vary isn't, it's remaining constant - (the human mapping analog to this is the notion many people have that Greenland is the size of a continent, but that's another issue :-) )

Without seeing your code it's difficult to guess the exact error, but my guess is that you may not have paid attention to the fact that d hat is a unit vector. Try this and see if it helps

1) compute the center of your approximation of a sphere 2) For each point that is a vertex of your approximation, compute |TheCenter - YourVertex|, i.e. subtract the vertex from the center and normalize the result - this gives you the unit vector you need 3) Use the unit vector x,y, and z coordinates in the equation you got from Wikipedia

Also note the comment about the sphere's poles being on the y axis - if this isn't what you want you will still get a uniform texture mapping, it just may not be oriented the way you want it to be

You should work at making sure you understand this before you move on to more complex UV generation - this is one of the simplest uv problems, and more complex ones can really be furballs :-)

\$\endgroup\$
1
  • \$\begingroup\$ You are right, the uv's are correct. The Problem was in the fragment shader for the height based textures. The shader was made for normal terrain and not for spherical terrain. \$\endgroup\$
    – Wipster
    May 16, 2013 at 6:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .