PDA

View Full Version : How to generate texture-coordinates for a geosphere



tabor25
06-10-2002, 01:59 AM
Hello,

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

tabor25

davepermen
06-10-2002, 02:08 AM
get the latitude and longitude of the sphere.. transform your xyz to a spherical coordinate system and use these

nutball
06-10-2002, 04:47 AM
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).