How to generate texture-coordinates for a geosphere


i need to calculate texture-coordinates for a geosphere, not a sphere with latitude and longitude lines. The geosphere approximates a sphere based on an icosahedron by subdividing triangles. So the points are not lying on latitude and longitude lines. Does someone know how to do this ?

Best regards


get the latitude and longitude of the sphere… transform your xyz to a spherical coordinate system and use these

Transform your points (x, y, z) into spherial polar coordinates (r, theta, phi), then map (theta, phi) onto (u, v).

You have to be a bit careful with triangles which overlap the wrap-round of theta (ie. where theta > 2*PI).